Converting data froma 12 byte array to a string value
-
Hi all Not sure if this is active anymore but here goes I have written a utility that goes with MS Flight Sim and I have been reading data from the Sim Program and displaying it with no trouble at all doing numbers etc for Speed and altitude. But I can not get Data for things that are stored in multi byte Arrays converted to a string. Code Follows if FSUIPC_Read($3130, 12, @AircraftType, dwResult) then begin if FSUIPC_Process(dwResult) then begin // How do I convert @aircraftType to a string // that I can then send to LabelFSAircraftType.Caption := end else begin LabelFSAircraftType.Caption := 'Processing: ' + ResultText[dwResult]; end; end else begin LabelFSAircraftType.Caption := 'Reading: ' + ResultText[dwResult]; end; Hopefully somebody will have some ideas Owen Moore
-
Hi all Not sure if this is active anymore but here goes I have written a utility that goes with MS Flight Sim and I have been reading data from the Sim Program and displaying it with no trouble at all doing numbers etc for Speed and altitude. But I can not get Data for things that are stored in multi byte Arrays converted to a string. Code Follows if FSUIPC_Read($3130, 12, @AircraftType, dwResult) then begin if FSUIPC_Process(dwResult) then begin // How do I convert @aircraftType to a string // that I can then send to LabelFSAircraftType.Caption := end else begin LabelFSAircraftType.Caption := 'Processing: ' + ResultText[dwResult]; end; end else begin LabelFSAircraftType.Caption := 'Reading: ' + ResultText[dwResult]; end; Hopefully somebody will have some ideas Owen Moore
-
Member 14803461 wrote:
// How do I convert @aircraftType to a string
It depends what it contains in the first place, and what is passed in to your program at that point.
I realise that. Aircraft type is actually text in the flight sim eg :Airbus A 330 . Documentation says it is limited to 12 characters including a zero terminator. I was assuming it was 12 bytes but maybe I am wrong. It may be just a string
-
Member 14803461 wrote:
// How do I convert @aircraftType to a string
It depends what it contains in the first place, and what is passed in to your program at that point.
Hi Richard I have been doing some testing and find hat if I set a Var of AircraftType: Array [1..12] of byte then Code of if FSUIPC_Read($3130, 12, @AircraftType, dwResult) then begin if FSUIPC_Process(dwResult) then begin label20.Caption :=ResultText[dwResult]; Etc etc Label20 gives me an ok which makes me think It is getting the data correctly but I dont know how to change it so I can see the data as a string to be attached to a label Owen
-
Hi Richard I have been doing some testing and find hat if I set a Var of AircraftType: Array [1..12] of byte then Code of if FSUIPC_Read($3130, 12, @AircraftType, dwResult) then begin if FSUIPC_Process(dwResult) then begin label20.Caption :=ResultText[dwResult]; Etc etc Label20 gives me an ok which makes me think It is getting the data correctly but I dont know how to change it so I can see the data as a string to be attached to a label Owen
-
Without knowing exactly what is in the data that you are receiving it is impossible to suggest anything.
Thanks for your time. I will see if I can find out Owen
-
Without knowing exactly what is in the data that you are receiving it is impossible to suggest anything.
Sometimes you cant see the wood for the trees. Got it all sorted thanks. It is actually stored as ascii Characters Thanks Owen