Sign in to follow this  
Guest patrickzfr

XML Syntax Help !

Recommended Posts

Hello!I am a newbie in XML programming and certainly many of you will smile by reading my request, but I feel much better in Visual Basic and do not easily convert myself to this so unusual way of xml programming and syntax ;-)Here is my question:In the small FS XML gauge I have in mind, I have 2 variables to compare and to do an action if a value is obtained in their substraction:Here is a piece of my code:(G:Var1) if{ (G:Var3) (G:Var2) 300 - > if{ 1 (>K:GEAR_UP) } }What I want is that if the difference between VAR3-VAR2 is 300, I send a Gear_Up command to FS.This code above, works.But now, I want to add in the line a second comparison opposite to the first one, that is: G:Var2-G:Var3=300 with a OR statement. So in Visual basic, the code would be:If ((VAR3-VAR2=300) OR (VAR2-VAR3=300)) THEN GEAR_UPVery simple in Basic language, but I tried many times in XML and Cannot obtain what I need...Could anyone have the charity to help me to translate this so simple BASIC line into XML for FS ??Many thanks in advance!

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Why don't you make the difference and remove the sign?If (ABS(VAR3-VAR2)>=300)) THEN GEAR_UP(G:Var1) if{ (G:Var3) (G:Var2) - abs 300 > if{ 1 (>K:GEAR_UP) } }Arne Bartels

Share this post


Link to post
Share on other sites

What a so quick and really working answer !!It looks so simple.. I am ashamed! I really need a good training.Many thanks to you Arne.

Share this post


Link to post
Share on other sites

Or even better (to avoid the "continuous event" bug):(G:Var1)if{ (G:Var3) (G:Var2) - abs 300> if{ (A:GEAR HANDLE POSITION,bool) if{ (>K:GEAR_UP) } }}I.o.w.: the GEAR_UP event is only given when needed.Cheers, Rob Barendregt

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