HP Fortran Programmer's Reference (September 2007)

HP Fortran statements
ENTRY
Chapter 10 349
ENTRY
Provides an additional external or module subprogram entry point.
Syntax
ENTRY
entry-name
[([
dummy-arg-list
])
[RESULT (
result-name
)]]
entry-name
is the name of the entry point (subroutine or function) defined by the ENTRY
statement. It must differ from the original subroutine or function name, and
from other ENTRY statement
entry-name
s specified in the subprogram in
which it appears.
dummy-arg-list
is a comma-separated list of dummy arguments for the subroutine or
function defined by the ENTRY statement. The same rules and restrictions
apply as for subroutine dummy arguments or function dummy arguments,
as appropriate.
result-name
is the result variable for a function defined by an ENTRY statement.
result-name
is optional; if not specified, the result variable is
entry-name
.
The RESULT (
result-name
) clause can only be specified when the ENTRY
statement is included in a function subprogram.
Description
When an ENTRY statement appears in a function subprogram, it effectively provides an
additional FUNCTION statement in the subprogram: execution starts from the ENTRY statement
when the
entry-name
is invoked (by being used). Similarly, an ENTRY statement in a
subroutine subprogram effectively provides an additional SUBROUTINE statement in the
subprogram, and execution starts from the ENTRY statement when the
entry-name
is called.
The following restrictions apply to the ENTRY statement:
The ENTRY statement can appear in an external subprogram or a module subprogram; it
may not appear in an internal subprogram. If the ENTRY statement appears in a function
subprogram, it defines an additional function; if it appears in a subroutine subprogram, it
defines an additional subroutine. The entry points thus defined can be referenced in the
same way as for a normal function name or subroutine name, as appropriate. Execution
starts at the ENTRY statement, and continues in the normal manner, ignoring any ENTRY
statements subsequently encountered, until a RETURN statement or the end of the
procedure is reached.