
Repetition
control
structures
5.3 Counted repetition constructs
Counted repetition occurs when the exact number of loop iterations is
known in advance. The execution of the loop is controlled by a loop
index, and instead of using DOWHILE, or REPEAT..UNTIL, the simple
keyword DO is used.
DO loop-index = initial-value to final-value
statement block
ENDDO
The DO loop does more than just repeat the statement block. It will
1 initialize the loop-index to the required initial-value;
2 increment the loop-index by 1, for each pass through the loop;
3 test the value of loop-index at the beginning of each loop to ensure
that it is within the stated rang ...