Archived

This topic is now archived and is closed to further replies.

n4gix

(A:AUTOPILOT MASTER,bool)

Recommended Posts

This is bizzare. This works (backwards of course): (A:AUTOPILOT MASTER,bool) 0 ==A/P But this will NOT work! (A:AUTOPILOT MASTER,bool) 1 ==A/P Neither does this! (A:AUTOPILOT MASTER,bool) 0 !=A/P Does anyone have any idea why???

Share this post


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

The SDK states:"The only reliable numeric equivalent is that 0 is returned for False. Non-zero values, especially both 1 and -1, are used to indicate True. "I'd believe the very first sentence religously.You might try looking at it as a number value instead of a bool value... oh, and according to the SDK, it's Bool.. not bool.

Share this post


Link to post
Share on other sites

Hi,May be it doesn't work in formattedtext, try normal textOtherwise something like:Color="%('color1' 'color1' (A:AUTOPILOT MASTER,bool) ?)" etc.%((A:AUTOPILOT MASTER,bool))%{if}A/P%{else}A/PBtw. i use (A:AUTOPILOT MASTER,bool)or(A:AUTOPILOT MASTER,bool) !Jan"Beatus ille qui procul negotiis..."

Share this post


Link to post
Share on other sites

Thanks, Jan.This works a treat:%((A:AUTOPILOT MASTER,bool))%{if}A/P%{else} However I could have sworn I'd already tried that variation at least once!

Share this post


Link to post
Share on other sites

Bill, the behavior you describe is really weird.(A:Autopilot Master,bool) MUST return 0 or 1 - no other option possible. Maybe the problem was elsewhere? The only Avar with bool unit that returns -1 is (A:HSI CDI NEEDLE VALID,bool) so far I've tested, which I assume as a code bug.Anyway, the very advantage of using bool unit is precisely that you don't need to make any comparison at all, just the Avar itself will put a 0 or 1 in the stack, as you've already noticed :-)And regarding Ed's comment on unit spelling, remember that variables, units and events are NOT case sensitive; they are translated to uppercase by the parser (then BOOL, Bool and bool are all ok)Tom

Share this post


Link to post
Share on other sites

>Bill, the behavior you describe is really weird.>(A:Autopilot Master,bool) MUST return 0 or 1 - no other option>possible. Maybe the problem was elsewhere? >The only Avar with bool unit that returns -1 is (A:HSI CDI>NEEDLE VALID,bool) so far I've tested, which I assume as a>code bug.Tom, I monitored the A:vars in question and they indeed did report correct values......so, obviously the problem must be that (A:var,unit) simply won't work with formatted text...I've used Jan's suggestion and simply put the conditions in the script and it seems to be working fine now... :-beerchug I truly hate having to do it this way since it's a major PITA, but that's they way the cookie crumbles... :(

Share this post


Link to post
Share on other sites