Enform Plus Reference Manual

Statements
Enform Plus Reference Manual422684-001
4-9
DECLARE Statement
DECLARE Statement
The DECLARE statement allows you to define a user variable, user aggregate, or user
table. The syntax of the DECLARE statement is:
user-aggregate-name, user-variable-name, or user-table-name
is the name of the declared element. Names of user-defined elements should
conform to the rules described under Rules for Naming User-Defined Elements on
page 3-6.
"[" max-subscript "]"
is the number of occurrences for the user table; the maximum number allowed is 64.
The max-subscript must be enclosed within brackets [ ]. See Subscripts on
page 3-8 for a description of subscripts.
formal-argument
is the name used to represent the actual argument of the user aggregate.
step-expression
is the operation to be performed for each record contributing to the user aggregate.
end-expression
is the operation to be performed after all qualifying records for the user aggregate
are processed by the step-expression.
initialize-constant
is the numeric literal that will be the starting value for the user aggregate.
internal-format
is the internal format for storing the user variable, aggregate or table.
display-format
is the default display format for printing the declared item.
{ { user-variable-name }
{ { user-table-name "[" max-subscript "]" } }
DECLARE { { user-aggregate-name ( formal-argument ) }
{ { = ( step-expression [ , [ end-expression ] }
{ { [ , initialize-constant ] ] ) }
}
[ INTERNAL internal-format ] }
[ AS display-format ] } ,... [ ; ]
[ HEADING heading-string ] }
}