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

Create Variable

Use this command to create a variable in Longview Application Framework. Variables are recognized only in the procedure in which they are created and any document called by the procedure subsequent to the creation of the variable.

For information on creating variables that can be used by other procedures and models, see Create GlobalVariable.

A variable can have either a string value, a numeric value, or an object value and can be created either as a single item or can contain a list or array of items.

You can use the CREATE VARIABLE command in conjunction with the SET VARIABLE command to retrieve the balance type or description for a symbol. For more information, see the Syntax examples.

Note: The names of variables in Longview Application Framework to be used in data event triggers are limited to 31 characters. The convention is E_DIMNAME (where DIMNAME is the first 26 characters of the dimension name). In the case where the first 26 characters of the dimension names are the same, the variables are named E_DIMNAME_N (where DIMNAME is the first 26 characters of the dimension, and N is the dimension number). For more information, see Working with event variables.

Syntax

CREATE VARIABLE 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 VARIABLE rSymbols AS RANGE

SET VARIABLE rSymbols = "SYMBOL1 | SYMBOL2 | SYMBOL3 | SYMBOL4"

 

// Create a variable of type object

CREATE VARIABLE TestObject as Object

Syntax example - For retrieving a symbol’s balance type

CREATE VARIABLE BALTYPE AS STRING

SET VARIABLE BALTYPE = [[SYMBOL, BALANCETYPE, A10021]]

Syntax example - For retrieving a symbol’s description

CREATE VARIABLE DESC AS STRING

SET VARIABLE DESC = [[SYMBOL, DESCRIPTION, A10021]]

See also

Published:

Create Variable

Use this command to create a variable in Longview Application Framework. Variables are recognized only in the procedure in which they are created and any document called by the procedure subsequent to the creation of the variable.

For information on creating variables that can be used by other procedures and models, see Create GlobalVariable.

A variable can have either a string value, a numeric value, or an object value and can be created either as a single item or can contain a list or array of items.

You can use the CREATE VARIABLE command in conjunction with the SET VARIABLE command to retrieve the balance type or description for a symbol. For more information, see the Syntax examples.

Note: The names of variables in Longview Application Framework to be used in data event triggers are limited to 31 characters. The convention is E_DIMNAME (where DIMNAME is the first 26 characters of the dimension name). In the case where the first 26 characters of the dimension names are the same, the variables are named E_DIMNAME_N (where DIMNAME is the first 26 characters of the dimension, and N is the dimension number). For more information, see Working with event variables.

Syntax

CREATE VARIABLE 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 VARIABLE rSymbols AS RANGE

SET VARIABLE rSymbols = "SYMBOL1 | SYMBOL2 | SYMBOL3 | SYMBOL4"

 

// Create a variable of type object

CREATE VARIABLE TestObject as Object

Syntax example - For retrieving a symbol’s balance type

CREATE VARIABLE BALTYPE AS STRING

SET VARIABLE BALTYPE = [[SYMBOL, BALANCETYPE, A10021]]

Syntax example - For retrieving a symbol’s description

CREATE VARIABLE DESC AS STRING

SET VARIABLE DESC = [[SYMBOL, DESCRIPTION, A10021]]

See also

For an optimal Community experience, Please view on Desktop