Structured Programming
en-938872/2 1 - 5
1
1.1.3 Nesting and Branches
Nesting
Fifteen structured nesting levels are possible independently of subroutine calls by
function G77 ...
Example:
First nesting level Second nesting level Third nesting level
IF
IF
ENDI
UNTIL
REPEAT
ENDI
Branches
Programming of a conditional or unconditional branch by G79 ... is allowed in a
structured sequence, but must branch to the lowest nesting level of the current
programme or subroutine.
Example:
%1 %2
IF G79 N100
good
WHILE REPEAT
G79 N100
good
IF
G77 H2 G79 N100
good
G79 N50
bad
G79 N50
bad
G79 N30
bad
ENDI
N30 N50
ENDW UNTIL
N50 N100
ENDI
N100
M02