MPE/iX Commands Reference Manual (32650-90877)

Chapter 14 631
Command List XII
Commands STREAM thru XEQ
Use HELP FUNCTIONS |OPERATORS |EXPRESSIONS for more info
The WHILE command evaluates expression and displays the result (TRUE or FALSE) to
$STDLIST. If expression does not resolve to a Boolean result, an error is reported.
The DO keyword is optional. It may be used or omitted and has no affect on the results.
Operation Notes
This command begins a WHILE block, which consists of all the commands lying between
WHILE and the next ENDWHILE statement. The ENDWHILE must have the same
nesting level as the WHILE statement. The ENDWHILE statement ends the WHILE
block.
The logical expression is evaluated and, as long as expression evaluates to TRUE, the
WHILE block is executed.
Nesting of IF and WHILE blocks is limited to a
combined
total of 30 levels. Each IF or
WHILE block read by the Command Interpreter increments the nesting count by 1.
NOTE
You may not write a WHILE construct in such a way that it physically crosses
from one user command (UDCs or command files) to another.
Use
This command may be issued from a session, job, program, or in BREAK. Pressing
Break
aborts the execution of this command.
Example
The following is an example of the WHILE command:
WHILE SETVAR (FILENAME, &
INPUT ("PLEASE ENTER THE NEXT FILENAME TO PURGE:") &
)<> "" DO
PLEASE ENTER THE NEXTFILENAME TO PURGE: OLDFILE1
*** EXPRESSION TRUE
CONTINUE
PURGE !FILENAME
ENDWHILE
Related Information
Commands ELSE, ELSEIF, ENDWHILE, ESCAPE, IF, RETURN, SETVAR, SHOWVAR
Manuals Appendix B, "Expression Evaluator Functions"
XEQ
Executes any program or command file. Its value lies in preventing any possible confusion
Other functions: FINFO, SETVAR
Table 14-1. Logical Operators - The WHILE Command