Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

WHILE Initiate WHILE block

&pagelevel(4)&pagelevel

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


0CMD0001No error

1CMD0202Syntax error

1SDP0118Command in false context

1SDP0139Back branch limit reached

1SDP0223Incorrect environment

3CMD2203Incorrect syntax file

32CMD0221System error (internal error)

64SDP0091Semantic error

130SDP0099No 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