|
Executable Block Statements - Assignment
The equal sign may be used in combination with the standard calculator operators and functions to assign the value on the right of the equal sign to the value on the left. A space must both precede and follow the equal sign. Only one assignment statement is allowed in each line.
Variable values may be adjusted by using them in combination with arithmetic operators, numbers and other variable values. Each operator must be preceded and followed by a space.
Three examples are shown below:
Example 1 is a combined arithmetic and assignment statement. HVAL is assigned a value equivalent to the value of CURR_TOOL plus 50.
Example 1:
HVAL = CURR_TOOL + 50 ;
In example 2 the value of the variable value SEQINCR is added to the previous value of SEQUENCE to give SEQUENCE a new value.
Example 2:
SEQUENCE = SEQUENCE + SEQINCR ;
In example 3, X becomes equal to the characters enclosed in the quotation marks but ignoring the spacing ( i.e. "Astringof_characters").
Example 3:
X = "A string of_characters."
When the value of a modal variable is changed as a result of the assignment statement, its indicator is set to "on". However, if the statement does not result in any change, the assignment statement will not turn it "on". Click here for a description of modal and non-modal variables.
Notes:
-
All variables must have the same format, except in the case where there are only two variables involved, i.e. VAR1 = VAR2.
-
It is the responsibility of the user to make sure that no mathematically impossible operations, such as division by zero, will result.
Division by zero may be avoided by using an IF_SET statement.
Example:
IF_SET (X _GT_ O) Y = A/X ; END_IF ;
|