DO WHILE, and DO ENDWHILE statements enable use of repetition (loop) logic in a Control-O rule. These statements can be used to repeatedly perform other DO actions for as long as a specified condition is met.
Figure 182 DO WHILE/DO ENDWHILE Parameter Format
Type WHILE in the DO field and press Enter. The word DO is replaced by WHILE on the screen. The same will occur when you type ENDWHILE in a DO field.
The basic format of WHILE and ENDWHILE statements is:
Figure 183 Format of WHILE and ENDWHILE Statements
WHILE conditional_expresssion1 [{AND|OR} conditional_expression2]
DO action
.
.
.
DO action
ENDWHILE
The WHILE conditional expression has the following format:
WHILE operand operator operand
Valid logical operators are shown in Table 148.
Table 148 DO WHILE and ENDWHILE Logical Operators
Operator |
Definition |
---|---|
EQ |
is equal to |
NE |
is not equal to |
GT |
is greater than |
GE |
is greater than or equal to |
LT |
is less than |
LE |
is less than or equal to |
Valid Boolean operators are shown in Table 149.
Table 149 DO WHILE and ENDWHILE Boolean Operators
Operator |
Definition |
---|---|
AND |
both expressions must be true |
OR |
either expression must be true |
Operators that end with the pound sign (#) are used for numeric comparisons, as opposed to string comparisons.
An operand can be any character string. It can also be composed of AutoEdit symbols. In such cases, it is resolved into a character string before the conditional expression is analyzed at execution time.
Whenever non-numeric comparison operators are specified, operands are compared as character strings from left to right.
An operand cannot be resolved into nulls (as in CLISTs). If it is possible that an operand will resolve into nulls, place a character before the first and second operands.
In the following example, the character B is placed before the two operands:
WHILE B%%A GT B%%C
Each WHILE statement must be terminated with an ENDWHILE statement.
Parent Topic |