Enform Plus Reference Manual

Enform Plus Language Elements
Enform Plus Reference Manual422684-001
3-27
Parameters
Parameters
You can use a parameter either for request qualification or as a target-item. You can pass
a parameter to a stored compiled query file. Define parameters by issuing the PARAM
statement, described on page 4-39
.
Enform Plus handles parameters syntactically as if they were literals. Enform Plus
handles any parameter declared with an alphanumeric internal format as a string literal;
it handles all other parameters as numeric literals. You must enclose a parameter with
parentheses wherever you would have to enclose a numeric literal with parentheses.
User Variables
A user variable can be used to store numeric or string literals, save a field value, or hold
the result of a calculation for later printing.
Before the user variable is specified in a query, the DECLARE statement (see page 4-9
for the syntax of the DECLARE statement) must be entered. This statement defines the
variable name and optionally defines the internal storage format (the default internal
storage format is a 64-bit signed integer), a default display format, and a default
heading. The name given to the user variable must conform to the naming conventions
described under Rules for Naming User-Defined Elements on page 3-6.
The default value of a user-declared variable is zero. An initial value for the user
variable can be defined with the SET statement.
User Variable as a Target-Item
When a user variable is specified as a target-item, Enform Plus uses the default value or
the initial value, whichever is appropriate. When a user variable is a target-item in a
LIST statement, assignment syntax can be used to specify a new value for the variable.
The value of a user variable changes as target list elements are evaluated, so that at any
time, the value of the user variable depends upon the value most recently assigned.
Assignment syntax is as follows:
user-variable-name-1
is the name of the user variable being defined.
aggregate
is the value of a predefined aggregate or user aggregate.
{ aggregate }
{ expression }
user-variable-name-1 := { field-name }
{ literal }
{ user-table-element }
{ user-variable-name-2 }