HP Fortran Programmer's Reference (September 2007)

HP Fortran statements
EXIT
Chapter 10 357
EXIT
Terminates a DO loop.
Syntax
EXIT [
do-construct-name
]
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:
“DO construct” on page 141
“Flow control statements” on page 146