Local Screen Variables

The screens can contain local variables. The local variables are initialized only when the screen is loaded in memory and can be used only inside the context of that screen. Therefore they can be used in the Screen's Il Logic and Script codes and in the objects it contains. Keep in mind that:

 

  1. the local variables in the script codes can only be managed by using the variable's name directly. The GetVariableValue() and SetVariableValue() functions do not support local variables

  2. when a local variable has the same name of a variable contained in the Real Time DB, priority will be given to the local variable. To access Real Time DB global variables you must use the following syntax:

 

..\<variable name>

 

Caution: this type of syntax is supported in the animation and command properties and IL Logic only. Therefore it is not possible to use the syntax in the Basic Script code.

 

The  "..\" suffix is needed for going back one hierarchy in a variable pointer. The hierarchy is as follows:

 

Local Screen Variables -> project Variables -> Parent project Variables

 

for instance, to access a variable from a parent project with the same Local Screen Variable name you must use this syntax:

 

..\..\<variable name>

 

The Local Variables cannot be retentive and cannot be used for communication. Furthermore they do not have all the properties that the global variables have.

 

Local variables are very handy to use with the symbol libraries. These variables are in fact exported to the template library on a par with global variables. When a template is then inserted on screen, its variables will be created as local variables by keeping the SHIFT key pressed down. If the SHIFT key is not pressed down the variables will be created as global variables in the Real Time DB.

 

Local Variables can be added by selecting the screen from the Project Explorer window and then activating the "Add New Local Variable..." command.

 

 

See Also