Enform Plus Reference Manual
Enform Plus Language Elements
Enform Plus Reference Manual—422684-001
3-28
User Variable as a Target-Item
expression
is an arithmetic expression or an IF/THEN/ELSE expression.
field-name
is the name of a database field.
literal
is a numeric literal or string literal that agrees in type with the user variable.
user-table-element
is the subscripted name of a user table element. You cannot assign a subscript range
to a user variable.
user-variable-2
is the name of a previously defined user variable.
When assignment syntax is used, Enform Plus reassigns a value to the user variable for
each target-record; therefore, the value of the user variable might be different for each
target-record. For example:
LIST u-var, u-var := salesman;
Enform Plus uses the default or initial value for the first occurrence of u-var in every
target-record. For the second occurrence of u-var Enform Plus uses the value of the
salesman field. This value changes for every target-record.
A user variable can be assigned the value of an expression that contains the user
variable. For example:
DECLARE u-var;
SET u-var TO 10;
OPEN parts;
LIST partname,
u-var := (u-var + 10);
Enform Plus uses the initial or default value of the user variable to determine the value
of the expression. In the example, the value of the expression is 20. Enform Plus then
assigns this value to the user variable. Within the same LIST statement, assignment
syntax can subsequently be used to assign the user variable to another expression
containing the user variable. For example:
DECLARE u-var;
SET u-var TO 10;
OPEN parts;
LIST partname,
u-var := (u-var +10),
u-var := (u-var +20);