Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Storing values into xml variables

Featured Replies

1.I wish to store a 0 or 1 into both the PWR_TOGGLE and LEFT_TURN variables. Why doesn

1.Because after you write a variable with the current stack value, the next value you write will be the value of "stackpointer-1".So what you need to do is place the value on the stack twice, using the "d" operator.I.e.:(L:PWR_TOGGLE, bool) ! d (>L:PWR_TOGGLE, bool) (>>L:LEFT_TURN, bool)2. Assuming that this variable just needs an initial value, and can be changed by the code later on: start your gauge code with an initialisation element, that is only executed once.Like:(L:INIT,bool) !if{ 1 (>L:INIT,bool) 25 (>L:VARIABLE_A,number)} Note: use an L:Var for this INIT variable, NOT an G:Var.Because a G:Var will be reset to 0 when you change from WindowedMode to FullScreenMode, vice versa.Cheers, Rob Barendregt

"(>>L:LEFT_TURN, bool"What purpose does the "greater than" symbol perform in xml when used in this manner?Glenn

Hi,"(>&g;L:LEFT_TURN, bool)"Is wrong, for sure Rob's typo :-). You may use(>L:LEFT_TURN, bool)or (>L:LEFT_TURN, bool)Because ">" is not supported by some editors, it can be replaced by ">" (forget the quotes)Regards,Tom

Thanks Tom ..Yes, that was a typo :-)Since I've ran into at least one situation where ">" didn't work in XML (can't remember why anymore) I'm used used to using ">" only ...Cheers, Rob

In answering question two regarding initializing variables, you wrote,"(L:INIT,bool) !if{ 1 (>L:INIT,bool) 25 (>L:VARIABLE_A,number) }"I don't understand the reason behind having the L:INIT variable. What purpose is it serving prior to putting value 25 into L:VARIABLE_A? Would you walk me through your thinking, please.Glenn

Let me see if I can get this right:The sim starts and looks at (L:INIT,bool) to see what it is reading ( a 1 or a zero) and you ask it to see if (L:INIT,bool) is equal to zero by adding !(L:INIT,bool) ! says Is (L:INIT,bool) 0 == , IF IT IS EQUAL TO ZERO if{Change its state to a 1 1 (>L:INIT,bool) so this sequence does not get repeated next time the gauge refreshes and also put 25 into a variable: 25 (>L:VARIABLE_A,number)So the gauge reads the state of L:init,bool, checks to see it is zero, id so changes it to a 1 and also puts 25 ( or your numbers) into a specified variable. It only does this when L:Init is zero, so will only do it the very first time the gauge is activated.I hope that makes sense?Steve

I think the light is slowly coming on.You use the bool variable value to prevent Variable A from being continously initialized each time the gauge is refreshed. Without it, I could never store another value into it, if needed, later in the program since that would be quickly overwritten by the initialization process that is taking place x-number of times per second. Without the bool var. check, the code is useless.Glenn

Bingo !

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.