Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Variable names

&pagelevel(4)&pagelevel

A variable name that designates a simple variable can be a component in an expression, provided that this variable is already initialized, i.e. has valid contents.

The rules for the formation of variable names are described in section “Variable names”.

When an expression is calculated, not the variable name but the contents of the variable are inserted.

The contents of a variable can have the data type INTEGER, BOOLEAN or STRING, i.e. they can be a number, a Boolean value or a string. Consequently, the rules that apply for evaluating variable contents are the same as those described in preceding sections for numbers, Boolean constants and strings.

If the contents of a variable are to be evaluated, the variable name must not be enclosed in single quotes. If it is enclosed in single quotes, the variable contents are not evaluated and the variable name is interpreted as a string.

Example

The following variable declarations and assignments are made:

/SET-VARIABLE A = 36
/SET-VARIABLE B = 72
/DECL-VARIABLE C

These variables are used in (simple) expressions:

/D = A + B

/E = A - C

“correct”

“incorrect”

The first assignment is valid, since variables A and B are correctly initialized. The second assignment in which variable E is to be initialized is invalid, since variable C is declared but not initialized.