November 26, 200421 yr 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!
November 26, 200421 yr 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
November 26, 200421 yr 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.
November 26, 200421 yr 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
Create an account or sign in to comment