PROGRAMMING16. CUSTOM MACRO
B–63684EN/01
274
The identification numbers (1 to 3) in a DO–END loop can be used as
many times as desired. Note, however, when a program includes crossing
repetition loops (overlapped DO ranges), alarm No. 124 occurs.
1. The identification numbers
(1 to 3) can be used as
many times as required.
WHILE [ … ] DO 1 ;
END 1 ;
:
WHILE [ … ] DO 1 ;
END 1 ;
WHILE [ … ] DO 1 ;
END 1 ;
:
WHILE [ … ] DO 2 ;
END 2 ;
WHILE [ … ] DO 1 ;
WHILE [ … ] DO 2 ;
:
WHILE [ … ] DO 3 ;
:
END 3 ;
:
END 2 ;
:
END 1 ;
WHILE [ … ] DO 1 ;
END 1 ;
IF [ … ] GOTO n ;
Nn
WHILE [ … ] DO 1 ;
END 1 ;
IF [ … ] GOTO n ;
Nn … ;
:
2. DO ranges cannot overlap.
Processing
Processing
Processing
Processing
Processing
3. DO loops can be nested to
a maximum depth of three
levels.
4. Control can be transferred to
the outside of a loop.
5. Branches cannot be made to
a location within a loop.
When DO m is specified without specifying the WHILE statement, an
infinite loop ranging from DO to END is produced.
When a branch to the sequence number specified in a GOTO statement
occurs, the sequence number is searched for. For this reason, processing
in the reverse direction takes a longer time than processing in the forward
direction. Using the WHILE statement for repetition reduces processing
time.
In a conditional expression that uses EQ or NE, a null value and zero have
different effects. In other types of conditional expressions, a null value
is regarded as zero.
D Nesting
Limitations
D Infinite loops
D Processing time
D Undefined variable