HP Fortran Programmer's Reference (September 2007)

Execution control
Flow control statements
Chapter 6148
Syntax
EXIT [
do-construct-name
]
Execution logic
If
do-construct-name
is specified, execution terminates for all DO loops that are within
range, up to and including the DO loop with that name. If no name is specified, execution
terminates for the immediately enclosing DO loop.
Example
DO
PRINT *, ”Enter a nonzero integer: ”
READ *, number
IF (number == 0) THEN
PRINT *, ”Bye”
EXIT
END IF
even_odd = MOD(number, 2)
IF (even_odd == 0) THEN
PRINT *, ”Even”
ELSE
PRINT *, ”Odd”
END IF
END DO
Assigned GO TO statement
The assigned GO TO statement transfers control to the statement whose statement label was
assigned to an integer variable by an ASSIGN statement.
Syntax
GO TO
integer-variable
[ , (
label-list
) ]
If
label-list
is present, then the label previously assigned to
integer-variable
must be in
the list.
Execution logic
Control transfers to the executable statement at
integer-variable
.
Example
INTEGER int_label
.
.
.
ASSIGN 20 TO int_label
.
.