FORTRAN Reference Manual
Statements
FORTRAN Reference Manual—528615-001
7-34
ENTRY Statement
When you invoke a function specified by this form, you must reference it as
name(). For example:
PROGRAM main
x = surcharge()
END
FUNCTION tax (a, b, c)
ENTRY surcharge
END
•
Dummy arguments
The dummy argument list in an ENTRY statement can be different from the dummy 
argument list in the FUNCTION or SUBROUTINE statement of the subprogram in 
which it appears, or from the argument lists in other ENTRY statements in the 
same program. However, the actual arguments in any reference to a subprogram 
entry point must agree in number, order, and data type with their associated 
dummy arguments.
An asterisk (*) dummy argument is allowed only in a SUBROUTINE ENTRY 
statement where it functions as an alternate return specifier. For additional 
information, see Section 4, Program Units.
•
Observe the following restrictions in using the ENTRY statement:
°
An entry point name has the scope of an executable program. It cannot appear 
both as an entry point name and as a dummy argument in a FUNCTION, 
SUBROUTINE, or other ENTRY statement. An entry point name can appear in 
a type statement.
°
You can reference an entry point name in any program unit of the executable 
program. The ANSI standard does not allow you to reference an entry point 
name in the program unit that declares it, but HP FORTRAN removes this 
restriction because it supports recursive subprograms.
°
If an entry point name in a function subprogram is of character type, every 
entry point name in the subprogram, and the name of the FUNCTION 
statement, must be of character type, and must specify the same character 
length: either a numeric value or an asterisk (*) enclosed in parentheses. If any 
of those names has a length specification of (*), all such entities must have a 
length specification of (*); otherwise, they must all have a length specification 
of the same integer value.
°
If the name of the FUNCTION statement is any type other than character, then 
the types of the entry point names can be the same as or different from the 
FUNCTION name and each other in any combination, but none can be type 
character.










