Top: f77 Up: 13 - Statements
Previous: 13,56 - REWRITE Next: 13,58 - Statement_Function
Section 13,57: SAVE
Declares that the values of data elements are to be saved across
invocations of a subprogram. Statement format:
SAVE [a[,a]...]
a Is the symbolic name of a common block (enclosed in
slashes), a variable, or an array.
A SAVE statement cannot include a blank common block, names of
entities in a common block, procedure names, and names of dummy
arguments.
Within a program unit, an entity listed in a SAVE statement does
not become undefined upon execution of a RETURN or END statement
within that program unit.
Even though a common block can be included in a SAVE statement,
individual entities within the common block could become undefined
(or redefined) in another program unit.
When a SAVE statement does not explicitly contain a list, it is
treated as though all allowable items in the program unit are
specified on the list.
NOTE: It is not necessary to use SAVE statements in DEC Fortran
programs. The definitions of data entities are retained
automatically by default, unless you specify the -assume recursive
compiler option. (Optimizations may also affect this. See your
user manual for more information.) However, the ANSI FORTRAN
Standard requires using SAVE statements for programs that depend on
such retention for their correct operation. If you want your
programs to be portable, you should include SAVE statements where
your programs require them.
The omission of such SAVE statements in necessary instances is not
flagged, even when you specify the -std compiler option, because
the compiler does not determine whether such dependences exist.
Top: f77 Up: 13 - Statements
Previous: 13,56 - REWRITE Next: 13,58 - Statement_Function