Purpose
The INTENT attribute specifies the intended use of dummy arguments.
Format
>>-INTENT--(--+-IN----+---)--+----+--dummy_arg_name_list------->< +-OUT---+ '-::-' '-INOUT-' |
Rules
The INTENT attribute can take three forms:
An actual argument that becomes associated with a dummy argument with an intent of OUT or INOUT must be definable. Hence, a dummy argument with an intent of IN, or an actual argument that is a constant, a subobject of a constant, or an expression, cannot be passed as an actual argument to a subprogram expecting an argument with an intent of OUT or INOUT.
An actual argument that is an array section with a vector subscript cannot be associated with a dummy array that is defined or redefined (that is, with an intent of OUT or INOUT).
A dummy argument with an intent of IN cannot be used as an actual argument for the LOC intrinsic function.
The %VAL built-in function, used for interlanguage calls, can only be used for an actual argument that corresponds to a dummy argument with an intent of IN, or that has no intent specified. This constraint does not apply to the %REF built-in function.
Attributes Compatible with the INTENT Attribute | |||
---|---|---|---|
|
PROGRAM MAIN DATA R,S /12.34,56.78/ CALL SUB(R+S,R,S) END PROGRAM SUBROUTINE SUB (A,B,C) INTENT(IN) A INTENT(OUT) B INTENT(INOUT) C C=C+A+ABS(A) ! Valid references to A and C ! Valid redefinition of C B=C**2 ! Valid redefinition of B END SUBROUTINE
Related Information