next up previous contents
Next: Named and Nested Loops Up: Control Flow Previous: Conditional Exit Loops

Conditional Cycle Loops

Can set up a non-incremental DO loop which, on some iterations, only executes a subset of the statements in the body of the loop,

    DO
     DO
      ...
      IF (a.GT.b) EXIT
      ...
      IF (a.EQ.b) CYCLE
      ...
     END DO
     IF (c.GT.d) EXIT
    END DO

CYCLE forces control to the innermost active DO statement and the loop begins a new iteration.

For more information, click here gif


next up previous contents
Next: Named and Nested Loops Up: Control Flow Previous: Conditional Exit Loops

Adam Marshall ©University of Liverpool, 1996
Fri Dec 6 18:56:08 GMT 1996
Not for commercial use.