Enform Plus Reference Manual

Enform Plus Language Elements
Enform Plus Reference Manual422684-001
3-29
User Variable in Request-Qualification
Enform Plus uses 20, the value assigned in the first assignment syntax (u-var + 10) for
the value of u-var in the second expression. After determining the value of the
expression ((u-var + 10) + 20), Enform Plus assigns the value of the expression, 40, to
the user variable.
Enform Plus performs this process for every target-record. Enform Plus continues to
reevaluate the value of a user variable until it encounters the end of the target-list.
User Variable in Request-Qualification
A user variable can be specified in a request-qualification. When a user variable is used
for request qualification, Enform Plus always uses either the default or initial value,
whichever is appropriate. Consider the following:
SET u-var to 10;
LIST ordernum,
u-var := (ordernum + u-var)
WHERE u-var > 10;
The preceding query always returns zero target-records, even though in every target-
record the value of u-var (ordernum + u-var) is greater than 10. No target-records
are returned because Enform Plus uses the initial value of the user variable to evaluate
the WHERE clause. Because u-var is set to 10, no target-records are selected for a
WHERE clause with a logical expression u-var > 10.
User Tables
User tables are special kinds of user variables that can store more than one value.
Currently a user table can have a maximum of 64 elements called occurrences. Enform
Plus issues an error message if you attempt to define a table with more than 64
occurrences.
The individual elements of a user table can be referenced by using subscripts. See the
description of Subscripts
on page 3-8 for more information.
Like user variables, user tables can be initialized by the SET statement. The default
value of all elements in a user table is zero. When a user table is specified as a target-
item, Enform Plus determines its value in the same way it determines the value of a user
variable. Assignment syntax can be used to assign values to single elements of a table.
Arithmetic Overflow Conditions
An arithmetic overflow condition can occur when Enform Plus computes a value for:
An arithmetic expression
A predefined aggregate (such as SUM or AVG) or a user-defined aggregate
An arithmetic overflow condition does not cause Enform Plus to issue either an error or
a warning message. Instead, Enform Plus truncates the result of the computation. If an
arithmetic overflow condition occurs when Enform Plus is computing an intermediate
result, Enform Plus uses the truncated result to complete the computation.