Jump to content
Sign in to follow this  
spokes2112

"disobedient" XML switch

Recommended Posts

Guest

Hi all, the newbie attacks againI am programming a switch, called "DC Service", that allows to show a two windows, initially hidden, when click on it, but only if the battery is onMy code is here:(L:DC Service, enum)(L:DC Service, enum) ! (>L:DC Service, enum) if{ (A:Electrical master battery,bool) } 844 (>K:PANEL_ID_TOGGLE) 845 (>K:PANEL_ID_TOGGLE)844 and 845 are the ID,s of the hidden windows to show.Of course, the switch will always change position when click on it, but ONLY if the battery is connected (another switch) it will show the hidden windows.My code doesn't work, and always show the hidden windows independently of the battery position.Correct my code, please.Regards,Rafael

Share this post


Link to post
Share on other sites

Rafael,Original:(L:DC Service, enum) ! (>L:DC Service, enum) if{ (A:Electrical master battery,bool) } 844 (>K:PANEL_ID_TOGGLE) 845 (>K:PANEL_ID_TOGGLE)With this example L:DC service gets queried again after it has been toggled within the same click and is checked with the BATT before the if{ toggle windows }:(L:DC Service, enum) ! (>L:DC Service, enum) + (A:Electrical master battery,bool) 1 == (L:DC Service, enum) 1 == & if{ 844 (>K:PANEL_ID_TOGGLE) 845 (>K:PANEL_ID_TOGGLE) }Also one note, you may see that I use 1 == or 0 == for arguments. That can keep things like using a single & & a m p ;much easier for code writing.. ( may not be better for comp. resources though ).. Possibly another thing, when using a ",enum" for example as a unit for a L: var, when the L:var is going to have only 2 states some rules for things like ! (not) may not work.. bool may be better. ( G:Vars work for me this way too) Just things noticed doing this stuff and not necessarily correct. Regards,Roman[link:www.packers.com]GREEN BAY PACKERS][/i :-ukliam :-beerchug


20AUG21_Avsim_Sig.png?dl=1  FS RTWR   SHRS F-111   JoinFS   Little Navmap 
 

 

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