Skip to main content
insightsoftware Documentation insightsoftware Documentation
{%article.title%}
Published:
Was this article helpful?
0 out of 0 found this helpful

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.

Copy

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

Syntax example

CREATE GLOBALVARIABLE rSymbols AS RANGE 
SET VARIABLE rSymbols = "SYMBOL1 | SYMBOL2 | SYMBOL3 | SYMBOL4"            

See also

Published:

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.

Copy

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

Syntax example

CREATE GLOBALVARIABLE rSymbols AS RANGE 
SET VARIABLE rSymbols = "SYMBOL1 | SYMBOL2 | SYMBOL3 | SYMBOL4"            

See also

For an optimal Community experience, Please view on Desktop