Purpose
The EXTERNAL attribute specifies that a name represents an external procedure, a dummy procedure, or a block data program unit. A procedure name with the EXTERNAL attribute can be used as an actual argument.
Format
>>-EXTERNAL--+-----+--name_list-------------------------------->< '- ::-' |
If an external procedure name or dummy argument name is used as an actual argument, it must be declared with the EXTERNAL attribute or by an interface block in the scoping unit, but may not appear in both.
If an intrinsic procedure name is specified with the EXTERNAL attribute in a scoping unit, the name becomes the name of a user-defined external procedure. Therefore, you cannot invoke that intrinsic procedure by that name from that scoping unit.
You can specify a name to have the EXTERNAL attribute appear only once in a scoping unit.
A name in an EXTERNAL statement must not also be specified as a specific procedure name in an interface block in the scoping unit.
Attributes Compatible with the EXTERNAL Attribute | ||||
---|---|---|---|---|
|
PROGRAM MAIN EXTERNAL AAA CALL SUB(AAA) ! Procedure AAA is passed to SUB END SUBROUTINE SUB(ARG) CALL ARG() ! This results in a call to AAA END SUBROUTINE
Related Information