6.2.4 ENTRY Statement

The ENTRY statement provides multiple entry points within a subprogram. It is not executable and can appear within a function or subroutine program after the FUNCTION or SUBROUTINE statement. Execution of a subprogram referred to by an entry name begins with the first executable statement after the ENTRY statement.

The ENTRY statement takes the following form:

ENTRY nam [([p [,p] . . . ])]
nam
Is the symbolic name of an entry point.
p
Is a dummy argument.

Rules and Behavior

CALL statements should be used to refer to entry names within subroutine subprograms.

Function references should be used to refer to entry names within function subprograms.

An entry name within a function subprogram can appear in a type declaration statement.

An EXTERNAL statement can specify an entry name and use that name as an actual argument, but not as a dummy argument.

An entry name cannot appear in executable statements that precede the ENTRY statement in which the entry name appears.

Alternate return arguments can be included in ENTRY statements, if the arguments have asterisks in the dummy argument list. ENTRY statements specifying alternate return arguments can be used only in subroutine subprograms.

Dummy arguments can be used in ENTRY statements even if they differ in order, number, type, and name from the dummy arguments used in the FUNCTION, SUBROUTINE, and other ENTRY statements in the same subprogram. However, each reference to a function, subroutine, or entry must use an actual argument list that agrees in order, number, and type with the dummy argument list in the corresponding FUNCTION, SUBROUTINE, or ENTRY statement.

Dummy arguments can be referred to only in executable statements that follow the first SUBROUTINE, FUNCTION, or ENTRY statement in which the dummy argument is specified. If a dummy argument is not currently associated with an actual argument, the dummy argument is undefined and cannot be referenced. Arguments do not retain their association from one reference of a subprogram to another.

ENTRY statements cannot appear within a CASE construct (Alpha only), an IF construct, or a DO loop.


Previous Page Next Page Table of Contents