Sign in to follow this  
taguilo

Newbie logic problem

Recommended Posts

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)

Share this post


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

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.

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