Terminates a DO loop.
Syntax
- do-construct-name
is the name given to the DO construct. If do-construct-name is specified, it must be the name of a DO construct that contains the EXIT statement.
Description
If you do not specify do-construct-name, the EXIT statement terminates the immediately enclosing DO loop. If you do specify it, the EXIT statement terminates the enclosing DO loop with the same name.
Examples
DO i = 1, 20 n(i) = 0 READ *, j IF (j < 0) EXIT n(i) = j END DO |
Related statements
CYCLE and DO
Related concepts
For related information, see the following: