FORTRAN Reference Manual
Statements
FORTRAN Reference Manual—528615-001
7-36
EQUIVALENCE Statement
EQUIVALENCE Statement
The EQUIVALENCE statement defines the sharing of storage space by two or more
entities in a program unit.
var-list
is a comma-separated list of variable names array names, array element names,
character substring names, or RECORD names.
Considerations
•
The compiler assigns the same storage location to all entities in var-list. If the
equivalenced items are of different data types, the EQUIVALENCE statement does
not cause type conversion nor imply mathematical equivalence.
•
Equivalencing specifies that all entities in var-list share the same first storage
word. For character entities, equivalencing specifies that all entities in the list share
the same first character storage position.
•
If var-list includes an array element, the number of subscript expressions must
be the same as the number of dimensions declared for that array. An
unsubscripted array name in an EQUIVALENCE statement implicitly specifies that
equivalencing begin with the first element of that array.
•
Subscript expressions, and substring expressions used in var-list must be
integer constant expressions.
•
Observe the following restrictions with the EQUIVALENCE statement:
°
var-list cannot contain names of external procedures, dummy arguments,
or variable names that are also function names.
°
You cannot use the EQUIVALENCE statement to assign the same storage
location to more than one element of the same array.
°
You cannot equivalence an entity of character type to an item of any other data
type.
°
You can equivalence RECORDs only to other RECORDs. For additional
information, see the Records on page 2-20.
EQUIVALENCE ( var-list) [, ( var-list) ]...










