
13. Program Support Functions
13.5 User Macro Specifications
359
Iteration
Format
WHILE [conditional expression] DOm ; (m = 1, 2, 3 ..... 127)
~
END m ;
While the conditional expression is established, the blocks from the following block to ENDm are
repeatedly executed; when it is not established, execution moves to the block after ENDm. DOm
may come before WHILE, WHILE [conditional expression] DOm and ENDm must be used as a pair.
IF WHILE [conditional expression] is omitted, these blocks will be repeatedly ad infinitum. The
repeating identification numbers range from 1 through 127 (DO1, DO2, DO3, ....... DO127). Up to
27 nesting levels can be used.
(1) Same identifier number can be used any number
of times.
Possible
Possible
WHILE ~ DO1 ;
END1 ;
WHILE ~ DO1 ;
END1 ;
(2) Any number may be used for the WHILE
−
DOm
identifier number.
Possible
WHILE ~ DO1 ;
END1 ;
~
WHILE ~ DO3 ;
END3 ;
~
~
WHILE ~ DO2 ;
END2 ;
~
~
WHILE ~ DO1 ;
END1 ;
~
~
(3) Up to 27 nesting levels for WHILE
−
DOm. "m" is
any number from 1 to 127 for the nesting depth.
P
o
s
s
ib
le
DO2
DO1
DO27
END 1 ;
WHILE ~ DO1 ;
WHILE ~ DO2 ;
WHILE~DO27;
END 2 ;
END 27 ;
:
:
(4) The number of WHILE
−
DOm nesting levels
cannot exceed 27.
Not
p
os
si
b
le
WHILE ~ DO1 ;
WHILE ~ DO2 ;
WHILE ~ DO3 ;
WHILE ~ DO28;
END 3 ;
END 28;
~
~
~
~
END 2 ;
:
END 1 ;
~
:
(Note)
:With nesting, "m" which has been used once
cannot be used.