Create GlobalVariable
Use this command to create a new global variable. Global variables can be used by any model or procedure within the main procedure. For example, if main procedure A calls two procedures B and C, and procedure B creates a global variable, procedures A and C can also recognize that variable.
Syntax
CREATE GLOBALVARIABLE VariableName [] AS STRING|NUM|RANGE|OBJECT
where:
- VariableName is the name of the variable to create, with the following recommended naming conventions for the purposes of more readily identifying a variable’s type:
Variable Type Recommended naming convention STRING
Prefix STRING variables with s.
NUM
Prefix NUM variables with n.
RANGE
Prefix RANGE variables with r.
OBJECT
Prefix OBJECT variables with o.
all
Variables in a list or array should also have their names prefixed with the lowercase letter l (for example, a variable for a list of a string values might be named lsTemp1.) This convention is also advisable in preventing potential conflicts caused by the overlapping of variable names and keywords that might be implemented in Longview Application Framework in future releases. Note that this is only a recommendation and not an actual requirement of the command.
- [ ] designates the variable is to be created as a list.
- STRING designates a string value.
- NUM designates a numeric value.
- RANGE designates a list of symbols.
- OBJECT designates an object instance.
Syntax example
CREATE GLOBALVARIABLE rSymbols AS RANGE
SET VARIABLE rSymbols = "SYMBOL1 | SYMBOL2 | SYMBOL3 | SYMBOL4"
See also