WHILE - repeat statements conditionally.

$*$WHILE
may take several forms. In the form
$*$WHILE expression : statement
the expression is evaluated and if the result is true (non-zero), EXEC executes the statement following the colon. This statement may be a TSS command or EXEC directive. After executing the statement, EXEC evaluates the expression again; if the expression is still true (non-zero), EXEC executes the statement again. This keeps repeating until the expression is found to be false (zero). Note that if the expression starts out as false, the statement is not executed at all.

$*$WHILE can also take the form

$*$WHILE expression
    statements
$*$EndWhile
This lets you repeat execution of a sequence of statements in the same way that the first form of $*$WHILE repeats a single statement. Statement blocks may contain $*$WHILE constructs of their own (nested WHILEs). See the section "Input Expansion" in the main explain file "expl exec" for more details that pertain to $*$WHILE statements.

$*$WHILE constructs do not work if the EXEC input is being taken from the terminal. $*$WHILE is only valid inside an EXEC file or a user-defined command.

Copyright © 2000, Thinkage Ltd.