Jump to content
Sign in to follow this  
Odaat

Simple Select Case XML Code Help Please

Recommended Posts

I've done several searches in this forum to find an example of what I am trying to do, but I've not found a working solution. Here is my code:

			<Element>				<Select>				<Value>(A:NUMBER OF ENGINES, NUMBER)</Value>				<Case Value="1">1 (>G:Var1)</Case>				<Case Value="2">2 (>G:Var1)</Case>				<Case Value="3">3 (>G:Var1)</Case>				<Case Value="4">4 (>G:Var1)</Case>				</Select>				<Position X="180" Y="180"/>				<FormattedText X="150" Y="16" Bright="Yes" Length="150" Font="Arial" FontSize="14" LineSpacing="16" Color="#CD8DC5">				<String>Number of Engines: %((G:Var1))%!d!%</String>				</FormattedText>			</Element>

All I'm trying to do at this point is to get my code to show the number of engines detected on the airplane. Right now, the gauge shows 0 where I am attempting to display the # of engines. Thank you.

Share this post


Link to post
Share on other sites

Try <Element> <Position X="100" Y="180"/> <Text X="150" Y="14" Bright="Yes" Length="150" Font="Arial" Color="#CD8DC5"> <String>%Number of Engines: %((A:NUMBER OF ENGINES, number))%!d!</String> </Text> </Element>


Paul EGLD

Share this post


Link to post
Share on other sites
Try <Element> <Position X="100" Y="180"/> <Text X="150" Y="14" Bright="Yes" Length="150" Font="Arial" Color="#CD8DC5"> <String>%Number of Engines: %((A:NUMBER OF ENGINES, number))%!d!</String> </Text> </Element>
Yes, I know this will work, thank you. This is more an exercise in learning how to write a select case. I want to add more code for each case once I understand the basic syntax of the select case.

Share this post


Link to post
Share on other sites

After spending some more time in the SDK, I determined how to do what I was trying to do with a case:

<String>%Number of Engines: %(4 3 2 1 0 5 (A:NUMBER OF ENGINES, NUMBER) case) %!d!</String>

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...