Generated from C.65.00 /SYSADMIN/PUB/MYCICAT last modified on Sun Aug 29 15:08:37 2004
WHILE causes the commands within a WHILE block to be executed repetitively as long as a specified condition is true. A WHILE block consists of all the commands between the WHILE and ENDWHILE commands.
WHILE expression [DO]
expression Logical expression, consisting of operands and relational operators. The DO keyword is optional. It may be used or omitted and has no affect on the results. 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.
This command begins a looping construct that 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. Expression is evaluated and as long as expression evaluates to TRUE, the WHILE block is executed. You may not write a WHILE construct in such a way that a WHILE begins in one User Command (UDCs or command files) and its corresponding ENDWHILE concludes the loop in another User Command. o To see a list of expression evaluator functions, type FUNCTIONS at the HELP prompt. Or, you may enter an individual function name for more specific information. o To see a list of FINFO options, type FINFO at the HELP prompt. o To see a list of predefined MPE/iX variables, type VARIABLES at the HELP prompt. Or, you may enter an individual variable name for more specific information. This command may be issued from a session, job, in BREAK, or from a program. Pressing [Break] aborts the execution of this command.
The following is an example of the WHILE command: WHILE SETVAR (filename, input("Enter the next filename & to purge: ")) <> "" DO CONTINUE PURGE !filename ECHO ![ups(filename)] has been purged. ENDWHILE This section of code will continue to ask for and purge files until the user enters a [Return] or the name of a file that does not exist.
Commands: DELTEVAR, ELSE, ELSEIF, ENDWHILE, IF, RETURN, SETJCW, SHOWJCW, SETVAR, SHOWVAR; see also FUNCTIONS and VARIABLES Manuals : Appendix B, "Expression Evaluator Functions," in the MPE/iX Commands Reference Manual (32650-90003) Back to Main Index