LF Fortran 95

RETURN Statement

Description

The RETURN statement causes a transfer of control from a subprogram back to the calling procedure. Execution continues at the statement following the procedure invocation.

Syntax

RETURN [alt-return]
Where:

alt-return is a scalar INTEGER expression.

Remarks

If alt-return is present and has a value n between 1 and the number of asterisks in the subprogram's dummy argument list, the CALL statement that invoked the subroutine transfers control to the statement identified by the nth alternate return specifier in the actual argument list.

Example

subroutine zee() return ! transfer of control back to caller end subroutine zee