5-86 Command Reference
WHILE
Purpose Repeats a sequence of commands as long as a condition is true.
Syntax WHILE

buffer-field1 comparison buffer-field2

.
.
.
ENDWHILE
Process The WHILE command repeats a sequence of commands as long as a condition is
true.
If the condition is true, the script executes the commands listed between WHILE
and ENDWHILE. When script reaches ENDWHILE, it checks the condition again. If
the condition still exists, it executes the commands again. If the condition is false,
the script branches to the line after ENDWHILE.

Buffer-field1

and
buffer-field2
are the compared items in the condition. They can
be one of the following:

Buffer-field

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
Number
String

Number prefixed by a
number sign (#)
ASCII string delimited
by double quotes.
Must be one
character long
Comparison is the operator used to compare
buffer-field1
and
buffer-field2
. It can
be one of the following:

Comparison

Description
= Equals
== Equals
<> Not equal
!= Not equal
> Greater than
>= Greater than or equal
< Less than
<= Less than or equal
NOTE: Use the BREAK command to break out of a WHILE loop prematurely. For example,
you could use it when an error occurs. Also, Do Not use WHILE inside a macro.