- Messages
- 371
- Country

Hi,
I come back; It was 1:30 Am in France.
Tgibson was not far from the solution.
As you probably noticed, when you want to use the symbol ° in FSX, this often causes an error or crash.
So I ask myself how FSX do write his .PLN file , which contain this character °.
So I opened a FSX .PLN file with an hexadecimal editor, because I suspected there had a ingeniousness : And I saw that it had the character 194 (C2 in hexa ) in front of each °, but it does not appear in a text editor.
So, with this character 194 in front of each °, no more worries.
I already stated this tip at the end of this post, few months ago : http://www.fsdeveloper.com/forum/showthread.php?t=359489
I saw also with the hexadecimal editor that the xml file had a invisible header composed of three special characters: 239, 187 and 191. I guess it must be the header recognition of an xml file, so since I add these 3 characters at the beginning of all my XML files.
To me th have a question :
Now that my problem is solved, if you have see my Save_FP.xml file, you have seen that I use 2 x 3 times this same portion of conversion code from decimal degrees to degrees, minutes, seconds
I use it for the departure position (LAT and LONG)
For the destination postion (LAT and LONG )
and in the loop to write all the waypoints of the flight plan.
Do you think that is possible to transform this portion of code in a Macro ?
My new code that works is (example with a waypoint latitude) :
And I use the same code with :
- (C:fs9gps:FlightPlanDepartureLatitude,degrees
- (C:fs9gps:FlightPlanDepartureLongitude,degrees)
- (C:fs9gps:FlightPlanDestinationLatitude,degrees)
- (C:fs9gps:FlightPlanDestinationLongitude,degrees)
and in the loop with :
- (C:fs9gps:FlightPlanWaypointLatitude,degrees)
- (C:fs9gps:FlightPlanWaypointLongitude,degrees)
Is there a advantage to do transform in Macro that if it is possible ? (code of this gauge is only executed when the user save this mofied flight plan, so the file is not executed all the time)
I think that it is not essential in this case . What do you think about this ?
And if yes, how do because, I don't understand the reading of the macro.
How write the macro, how send the command and the value, and how get the return value.
I come back; It was 1:30 Am in France.
Tgibson was not far from the solution.
As you probably noticed, when you want to use the symbol ° in FSX, this often causes an error or crash.
So I ask myself how FSX do write his .PLN file , which contain this character °.
So I opened a FSX .PLN file with an hexadecimal editor, because I suspected there had a ingeniousness : And I saw that it had the character 194 (C2 in hexa ) in front of each °, but it does not appear in a text editor.
So, with this character 194 in front of each °, no more worries.
I already stated this tip at the end of this post, few months ago : http://www.fsdeveloper.com/forum/showthread.php?t=359489
I saw also with the hexadecimal editor that the xml file had a invisible header composed of three special characters: 239, 187 and 191. I guess it must be the header recognition of an xml file, so since I add these 3 characters at the beginning of all my XML files.
To me th have a question :
Now that my problem is solved, if you have see my Save_FP.xml file, you have seen that I use 2 x 3 times this same portion of conversion code from decimal degrees to degrees, minutes, seconds
I use it for the departure position (LAT and LONG)
For the destination postion (LAT and LONG )
and in the loop to write all the waypoints of the flight plan.
Do you think that is possible to transform this portion of code in a Macro ?
My new code that works is (example with a waypoint latitude) :
Code:
(* Waypoint position latitude *)
(* latitude Hundredth of Seconds*)
(C:fs9gps:FlightPlanWaypointLatitude,degrees) abs 1 % 60 * 1 % 60 * 1 % 100 * near (>L:Hundredth_Seconds,number)
'Hundredth_Seconds_String' (>C:XMLVARS:SearchVarName,string)
(L:Hundredth_Seconds,number) 10 < if{ '0' (L:Hundredth_Seconds,number) scat (>C:XMLVARS:StringValue,string) } els{ (L:Hundredth_Seconds,number) (>C:XMLVARS:StringValue,string) }
(* latitude Seconds*)
(C:fs9gps:FlightPlanWaypointLatitude,degrees) abs 1 % 60 * 1 % 60 * near (>L:Seconds,number)
(C:fs9gps:FlightPlanWaypointLatitude,degrees) abs 1 % 60 * flr (>L:Minutes,number)
(C:fs9gps:FlightPlanWaypointLatitude,degrees) abs flr (>L:Degrees,number)
(L:Seconds,number) 60 == if{ (L:Minutes,number) 1 + (>L:Minutes,number) 0.00 (>L:Seconds,number) }
(L:Minutes,number) 60 == if{ (L:Degrees,number) 1 + (>L:Degrees,number) 0 (>L:Minutes,number) }
(* Latitude degrees *)
'VarTemp' (>C:XMLVARS:SearchVarName,string)
(L:Degrees,number) flr (>C:XMLVARS:StringValue,string)
(C:fs9gps:FlightPlanWaypointLatitude,degrees) 0 < if{ 'S' (C:XMLVARS:StringValue,string) scat (>C:XMLVARS:StringValue,string) } els{ 'N' (C:XMLVARS:StringValue,string) scat (>C:XMLVARS:StringValue,string) }
'VarWaypointLatitude' (>C:XMLVARS:SearchVarName,string) (C:XMLVARS:StringValue,string) 'VarTemp' (>C:XMLVARS:SearchVarName,string) (C:XMLVARS:StringValue,string) scat 194 chr scat '° ' scat 'VarWaypointLatitude' (>C:XMLVARS:SearchVarName,string) (>C:XMLVARS:StringValue,string)
(* Latitude minutes *)
'VarTemp' (>C:XMLVARS:SearchVarName,string)
(L:Minutes,number) flr (>C:XMLVARS:StringValue,string)
'VarWaypointLatitude' (>C:XMLVARS:SearchVarName,string) (C:XMLVARS:StringValue,string) 'VarTemp' (>C:XMLVARS:SearchVarName,string) (C:XMLVARS:StringValue,string) scat ''' ' scat 'VarWaypointLatitude' (>C:XMLVARS:SearchVarName,string) (>C:XMLVARS:StringValue,string)
(* Latitude seconde et centieme de seconde *)
'Hundredth_Seconds_String' (>C:XMLVARS:SearchVarName,string)
(L:Seconds,number) (C:XMLVARS:StringValue,string) scat 'VarTemp' (>C:XMLVARS:SearchVarName,string) (>C:XMLVARS:StringValue,string)
(C:XMLVARS:StringValue,string) slen (>G:Var9) (C:XMLVARS:StringValue,string) 0 (G:Var9) 1 - ssub (>C:XMLVARS:StringValue,string)
'VarWaypointLatitude' (>C:XMLVARS:SearchVarName,string) (C:XMLVARS:StringValue,string) 'VarTemp' (>C:XMLVARS:SearchVarName,string) (C:XMLVARS:StringValue,string) scat '"' scat 'VarWaypointLatitude' (>C:XMLVARS:SearchVarName,string) (>C:XMLVARS:StringValue,string)
And I use the same code with :
- (C:fs9gps:FlightPlanDepartureLatitude,degrees
- (C:fs9gps:FlightPlanDepartureLongitude,degrees)
- (C:fs9gps:FlightPlanDestinationLatitude,degrees)
- (C:fs9gps:FlightPlanDestinationLongitude,degrees)
and in the loop with :
- (C:fs9gps:FlightPlanWaypointLatitude,degrees)
- (C:fs9gps:FlightPlanWaypointLongitude,degrees)
Is there a advantage to do transform in Macro that if it is possible ? (code of this gauge is only executed when the user save this mofied flight plan, so the file is not executed all the time)
I think that it is not essential in this case . What do you think about this ?
And if yes, how do because, I don't understand the reading of the macro.
How write the macro, how send the command and the value, and how get the return value.
Last edited:





