- Messages
- 1,564
- Country

Hello,
I’m trying to create a string based on an enum value.
The enum is (C:fs9gps:FlightPlanWaypointType) and the string is either 'UNKN', 'AIRPORT', 'INTERSECTION', 'VOR', 'NDB', or 'USER' depending upon the value of the enum.
My application is not a formatted text situation where the following {case} syntax works:
But rather, a LOGGER application:
where Something {case} is where I hoped to make use of {case} to create the appropriate string – in one line of script.
The following works, but requires multiple if{ statements:
What is the proper syntax using {case} to do the same as those 6 if{ statements? I’ve worked it for hours but the answer still escapes me.
Any solutions? Thanks in advance.
Bob
I’m trying to create a string based on an enum value.
The enum is (C:fs9gps:FlightPlanWaypointType) and the string is either 'UNKN', 'AIRPORT', 'INTERSECTION', 'VOR', 'NDB', or 'USER' depending upon the value of the enum.
My application is not a formatted text situation where the following {case} syntax works:
Code:
<String>
%((C:fs9gps:FlightPlanWaypointType))%{case}%{:0}UNKN%{:1}AIRPORT%{:2}INTERSECTION%{:3}VOR%{:4}NDB%{:5}USER%{end}
</String>
But rather, a LOGGER application:
Code:
:101
(L:WaypointsWritten,enum) (>C:fs9gps:FlightPlanWaypointIndex)
(C:fs9gps:FlightPlanWaypointType) [COLOR="Red"]Something {case}[/COLOR] (>C:LOGGER:string)
(L:WaypointsWritten,enum) 1 + (>L:WaypointsWritten,enum)
(L:WaypointsWritten,enum) (C:fs9gps:FlightPlanWaypointsNumber) < if{ g101 }
where Something {case} is where I hoped to make use of {case} to create the appropriate string – in one line of script.
The following works, but requires multiple if{ statements:
Code:
:101
(L:WaypointsWritten,enum) (>C:fs9gps:FlightPlanWaypointIndex)
(C:fs9gps:FlightPlanWaypointType) 0 == if{ ‘UNKN’ (>C:LOGGER:string) }
(C:fs9gps:FlightPlanWaypointType) 1 == if{ ‘AIRPORT’ (>C:LOGGER:string) }
(C:fs9gps:FlightPlanWaypointType) 2 == if{ ‘INTERSECTION’ (>C:LOGGER:string) }
(C:fs9gps:FlightPlanWaypointType) 3 == if{ ‘VOR’ (>C:LOGGER:string) }
(C:fs9gps:FlightPlanWaypointType) 4 == if{ ‘NDB’ (>C:LOGGER:string) }
(C:fs9gps:FlightPlanWaypointType) 5 == if{ ‘USER’ (>C:LOGGER:string) }
(L:WaypointsWritten,enum) 1 + (>L:WaypointsWritten,enum)
(L:WaypointsWritten,enum) (C:fs9gps:FlightPlanWaypointsNumber) < if{ g101 }
What is the proper syntax using {case} to do the same as those 6 if{ statements? I’ve worked it for hours but the answer still escapes me.
Any solutions? Thanks in advance.
Bob

