5-46 Command Reference
IF
Purpose Performs a series of one or more commands if a certain condition exists.
Syntax IF
buffer-field1
comparison

buffer-field2

.
.
.
[ELSEIF

buffer-field2 comparison buffer-field4

]
.
.
.
[ELSE]
.
.
.
ENDIF
Process The IF command directs script flow by determining if a condition or series of
conditions exist. A condition is specified by comparing buffer fields. If the
comparison is true (the condition exists), the script executes the commands on the
lines following the condition. If the comparison is not true (the condition does not
exist), control passes to the
line after the ENDIF.
next ELSEIF.
first line after the ELSE.
You may nest IFs, but every IF must have a corresponding ENDIF.
NOTE: Do not use IF inside a macro.
The

buffer-fields

can be one of the following:

Buffer-fields

Description
INPUT Input Buffer
Logical Field Name
(TEMP1)
Temporary Buffer
Field
Logical Field Name (LU1) Lookup Buffer Field
Logical Field Name (PR1) Printer Buffer Field
Logical Field Name
(Field1) [Index]
Array Buffer Field
String
Number
ASCII string delimited
by double quotes
Number prefixed by a
number sign (#)