ENFORM Reference Manual

PARAM Statement
Statements
058057 Tandem Computers Incorporated 4–41
How ENFORM Treats
Parameters
ENFORM treats a parameter syntactically as if it were a literal. ENFORM handles
parameters declared with an alphanumeric internal format as string literals. ENFORM
handles all other parameters as numeric literals. When you specify a parameter as a
target-item or as an item in a print-list, you must enclose the parameter in parentheses
just as you would an actual numeric literal. For example, suppose rept, a compiled
query file, contains the following ENFORM statements:
PARAM reptnum I3;
TITLE "REPORT ", (reptnum);
OPEN parts;
LIST parts;
Notice that reptnum is enclosed in parentheses when specified in the TITLE statement.
To provide a value for reptnum, enter the following Command Interpreter PARAM
command:
:PARAM reptnum 333
If you then specify the ENFORM command:
:ENFORM/IN rept,OUT $s/
the resulting report is:
REPORT 333
Part
Number PARTNAME INVENTORY LOCATION PRICE
------ ------------------ --------- -------- ---------
212 SYSTEM 192KB CORE 7 J87 92000.00
244 SYSTEM 192KB SEMI 3 B78 87000.00
1403 PROC 96KB SEMI 21 A21 22000.00
... ... ... ... ...
You can use a parameter wherever a literal is allowed. In certain cases, ENFORM
allows you to use a parameter but treats the parameter strictly as a numeric literal.
Therefore, you cannot change the value of the parameter at execution time. ENFORM
treats a parameter strictly as a numeric literal when you use the parameter as:
a subscript
the “max-subscript” in the declaration of a user table.
the integer in a FORM, SKIP, TAB, or SPACE clause.
the integer in a pattern-match string of a logical expression.
ENFORM issues a warning message when you have specified a parameter in this
manner.