HP Fortran Programmer's Reference (September 2007)

HP Fortran statements
ENTRY
Chapter 10350
The RESULT (
result-name
) clause can only be specified when the ENTRY statement is
included in a function subprogram. If specified,
result-name
must differ from
entry-name
, and
entry-name
must not appear in any specification statement in the
scoping unit of the function subprogram;
entry-name
assumes all the attributes of
result-name
. The RESULT clause in an ENTRY statement has the same syntax and
semantics as in a FUNCTION statement.
If the ENTRY statement appears in a function, the result variable is that specified in the
FUNCTION statement; if none is specified, the result variable is
entry-name
.
If the characteristics of the result variable specified in the ENTRY statement are the same
as those of the result variable specified in the FUNCTION statement, then the result
variable is the same, even though the names are different. If the characteristics are
different, then the result variables must be:
Nonpointer scalars of intrinsic type
Storage associated
If any is of character type, they must all be of character type and must all have the
same length. If any is of noncharacter type, they must all be of noncharacter type.
The result variable may not appear in a COMMON, DATA, or EQUIVALENCE statement. Also,
the result variable may not have the ALLOCATABLE, INTENT, OPTIONAL, PARAMETER, or
SAVE attribute.
•IfRECURSIVE is specified on the FUNCTION statement at the start of a function
subprogram, and RESULT is specified on an ENTRY statement within the subprogram, then
the interface of the function defined by the ENTRY statement is explicit within the function
subprogram; the function can thus be invoked recursively. (Note that the keyword
RECURSIVE is not given on the ENTRY statement, but only on the FUNCTION statement.)
•IfRECURSIVE is specified on the SUBROUTINE statement at the start of a subroutine
subprogram, the interface of the subroutine defined by an ENTRY statement within the
subprogram is explicit within the subprogram; the subroutine can thus be called
recursively.
A dummy argument in an ENTRY statement must not appear in an executable statement
preceding the ENTRY statement, unless it also appears in a FUNCTION, SUBROUTINE, or
ENTRY statement preceding the executable statement.
If a dummy argument in a subprogram—that is, as specified in a FUNCTION or SUBROUTINE
statement at the start of the subprogram or in any ENTRY statements within the
subprogram—is used in an executable statement, then the statement may only be
executed if the dummy argument appears in the dummy argument list of the procedure