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

Conditional Exit Loops

Can set up a non-incremental DO loop which is terminated by simply jumping out of it,

    DO 
     DO
      ...
      IF (a.GT.b) EXIT
      ...
     END DO
     ! if a.GT.b control jumps here
     IF (c.GT.d) EXIT
    END DO
    ! if c.GT.d control jumps here

The EXIT statement tells control to jump out of the current DO loop.

It is not possible to jump into a loop.

For more information, click here gif


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

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