Jump to content
Sign in to follow this  
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???


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites

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.


Ed Wilson

Mindstar Aviation
My Playland - I69

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!


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

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... :(


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

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  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...