FORTRAN Reference Manual

Statements
FORTRAN Reference Manual528615-001
7-55
GO TO Statement
PARAMETER, SAVE, INTRINSIC, DATA, or COMMON statement, except as a
common block name. FORTRAN replaces dmy with an actual argument when it
executes the function.
If dmy is an array name, you must dimension the array within the function
subprogram using a DIMENSION or type statement. For the use of adjustable
dimension declarators and for further information about function subprograms, see
Section 4, Program Units.
Example
The following example shows the external function OVERTIME, which calculates
overtime pay, given the number of hours worked and the hourly rate.
FUNCTION overtime (rate, hours)
over = hours - 40
xpay = rate * 1.5
overtime = over * xpay
END
GO TO Statement
The GO TO statement transfers control to another statement in the same program unit.
FORTRAN provides the following three forms of the GO TO statement:
Unconditional GO TO statement:
Computed GO TO statement:
Assigned GO TO statement:
label
is an integer that designates the label of an executable statement within the same
program unit.
exp
is an integer arithmetic expression.
GO TO label
GO TO ( label [, label ]... ) [,] exp
GO TO ivar [ [,] ( label [, label ]... ) ]