Lesson 4: WHILE [ MPE V to MPE XL: Getting Started ] MPE/iX 5.0 Documentation
MPE V to MPE XL: Getting Started
Lesson 4: WHILE
The new WHILE (...ENDWHILE) command allows for expression evaluation,
which adds a looping capability that can be used to control the sequence
of command execution.
Consider this command file.
SETVAR filenum,4
WHILE SETVAR (filenum, filenum-1) >= 0 DO
PURGE myfile!filenum
ENDWHILE
The above example will purge all occurrences of the file MYFILE# starting
with MYFILE3 until the FILENUM value of -1 is met (for example, myfile3,
myfile2, myfile1, myfile0).
Exercises
6. Using the WHILE command, write a command file that will count to 10
and then end when the set limit has been reached.
7. Write a command file that counts to 50 by twos.
MPE/iX 5.0 Documentation