BadB0Y Posted May 12, 2006 Report Posted May 12, 2006 Hi guys, I'm trying read "Name of current Aircraft" - 3D00, but it doesn't work. I don't know the delphi code to read zero-terminated strings. I have been testing many ways but .... :( Some example code?? help me please !! Regards Daniel
washburn_it Posted May 12, 2006 Report Posted May 12, 2006 I'm not at home so I can't try but have you tried with PCHAR type? Example: var airName: PChar; Regards, Bob
washburn_it Posted May 12, 2006 Report Posted May 12, 2006 I tried this and it worked: function ReadAircraftName(): string; var str : string; aName : array[0..255] of Char; dwResult: DWord; begin FSUIPC_Read($3D00, 256, @aName, dwResult); FSUIPC_Process(dwResult); str:= aName; Result:= Trim(str); end; Regards, Bob
BadB0Y Posted May 15, 2006 Author Report Posted May 15, 2006 It works very well. Thanks so much. :) Regards, Daniel
washburn_it Posted May 15, 2006 Report Posted May 15, 2006 I'm glad it worked (well...I already knew that LOL) Regards, Bob
Recommended Posts