November 1, 200520 yr I am trying to write a guage that displays a different bitmap depending on certain combinations of spoiler and flap handle positions. I think I am using the If statement incorrectly but cannot find a good example of a nested if statement. Perhaps there is a better way.Any insight would help.- Chris (A:SPOILERS LEFT POSITION, percent) 1 >=; (A:FLAPS HANDLE INDEX, enum) 4 > && if{ 3 (>L:SpeedBrakeCond, number) } (A:SPOILERS LEFT POSITION, percent) 1 >=; (A:FLAPS HANDLE INDEX, enum) 4 <=; && if{ 2 (>L:SpeedBrakeCond, number) } (A:SPOILERS LEFT POSITION, percent) 1 >=; (A:FLAPS HANDLE INDEX, enum) 2 <=; && if{ 1 (>L:SpeedBrakeCond, number) } (A:SPOILERS LEFT POSITION, percent) 1 < (A:FLAPS HANDLE INDEX, enum) 0 == && if{ 0 (>L:SpeedBrakeCond, number) } (L:SpeedBrakeCond, number)
November 1, 200520 yr Author Hi,It seems to be a logical issue here, because(A:FLAPS HANDLE INDEX, enum) 4 <=; and(A:FLAPS HANDLE INDEX, enum) 2 <=; Both return the same bool value when result is 2 or less , but you are assigning different (SpeedBrake) valuesI guess you actually want to do (A:FLAPS HANDLE INDEX, enum) 2 > 4 <= so you might replace the sentence with (A:FLAPS HANDLE INDEX, enum) 4 <=; for something like (not tested):(A:SPOILERS LEFT POSITION, percent) 1 >=; (A:FLAPS HANDLE INDEX, enum) d 2 > 0 max 4 <= * && if{ 2 (>L:SpeedBrakeCond, number) } Some better and faster approaches can be achieved if you know how to deal with registers (s0,s1, etc-l0,l1 etc)Regards,Tom Edit: Lately I recalled of semicolon after ">=", you should erase it from the code to work ok.
Create an account or sign in to comment