Domain: PROCEDURE
Command description
WHILE initiates a WHILE block, i.e. a WHILE loop: execution of the command sequence within the WHILE block is repeated as long as the condition specified in the WHILE command is met. If the condition is not met, the loop is terminated and procedure execution resumes with the command following the terminating END-WHILE command. (See the remarks on control structures in section “WHILE block” (Defining loops ) for more information.)
Expressions are replaced in the operand only when entering the WHILE loop, but not each time the loop is executed.
Format
WHILE |
CONDITION = <text 0..1800 with-low bool-expr> |
Operands
CONDITION = <text 0..1800 with-low bool-expr>
Logical expression as the condition for re-executing the commands in the WHILE loop (see chapter “Expressions” for information on logical expressions).
Command return codes
(SC2) | SC1 | Maincode | Meaning |
0 | CMD0001 | No error | |
1 | CMD0202 | Syntax error | |
1 | SDP0118 | Command in false context | |
1 | SDP0139 | Back branch limit reached | |
1 | SDP0223 | Incorrect environment | |
3 | CMD2203 | Incorrect syntax file | |
32 | CMD0221 | System error (internal error) | |
64 | SDP0091 | Semantic error | |
130 | SDP0099 | No further address space available |
Example
/ "Reduce list variable LIST-A to last 250 elements" /WHILE (SIZE ('LIST-A') > 250) / FREE-VARIABLE LISTE-A# /END-WHILE