Codecore Logo
Quick Search
»
Advanced Search »

Variables

RSS
There are generally 3 different types of variables that are used in Elve.

From Wikipedia: A variable is a storage location and an associated symbolic name which contains some known or unknown quantity or information, a value.

1. Global Variables: This refers to the use of a global variable driver instance, ie a global variable device. The driver can be used to stored information (named variable data) and referenced by rules or touch screen event actions. Global variables can not be used by a touch screen interface for property binding. The system is normally initially configured with a global variable device named vars.

Example:

var.MyVariable = 100; // set a global variable

// You can then reference this variable in another script, for example:
lighting.SetLightLevel(1, var.MyVariable);

2. Local Variables: This normally refers to the creation and use of a local variable within a script. The scripting language allows assigning variables which only live during the execution of the script and are no longer available when the script completes.

For example:

level = lighting.LightLevels[1]; // set a local variable to the level of a light
level = level + 5; // increment the local variable value
if (level <= 100)
    lighting.SetLightLevel(1, level);

3. Touch Screen Variables: This refers to variables that can be set within a touch screen interface and ONLY referenced within that touch screen interface's scripts and a property index via binding. These variables can be set by:

  • A Loader Button control
  • The action list editor: Add Action -> Touch Screen -> Set Variable Value
  • A script: TopTouchScreen.SetVariable("name", "value");
Privacy Policy | Conditions Of Use

Copyright ©2014 Codecore Technologies, All rights reserved.