ENFORM User's Guide
Selecting Information
Developing an ENFORM Query
3–26 058058 Tandem Computers Incorporated
In Figure 3-9 the value of the user variable u-var remains constant for each target
record. A user variable specified as part of a target list does not always maintain a
constant value. Consider the following query where assignment syntax is used to
assign a value to the user variable user-var:
OPEN order;
DECLARE user-var;
SET user-var TO 10;
LIST ordernum,
user-var := (ordernum + user-var),
user-var := (ordernum + user-var);
ENFORM determines the value of user-var in this query as follows:
1. ENFORM determines the value of the first arithmetic expression in the target-list.
Within the arithmetic expression, user-var has a value of 10 (the initial value
defined in the SET statement) and the value of the arithmetic expression is
ordernum + 10.
2. ENFORM assigns the value of the arithmetic expression to the first instance of
user-var.
3. ENFORM determines the value of the second arithmetic expression in the target-
list. Within the second expression user-var has the value (ordernum + 10); therefore
the value of the second arithmetic expression is ordernum + (ordernum + 10 ).
4. ENFORM assigns the value of the second arithmetic expression to the second
instance of user-var.
ENFORM continues the process of re-evaluating the value of user-var until it
encounters the end of the target-list. ENFORM repeats the process (beginning with the
initial value defined in the SET statement) for every target-record.