HP 3000 Manuals

SAVE Statement (Nonexecutable) [ HP FORTRAN 77/iX Reference ] MPE/iX 5.0 Documentation


HP FORTRAN 77/iX Reference

SAVE Statement (Nonexecutable) 

The SAVE statement causes the specified variables in the program unit to
maintain their values after the execution of a RETURN or END statement.

	       Click here to view figure.
            

Semantics 

The following items must not be mentioned in a SAVE statement:  formal
argument names, procedure names, and names of variables in a common
block.

A SAVE statement without a list of variable names or common block names
declares that all allowable variables in the subprogram must be saved.

The total size of local variables in a single subroutine must be less
than one gigabyte.  (A gigabyte is 1,073,741,824 (230) bytes.) 

When a common block name is specified, all of the variables in that
common block are saved.  Within an executable program, if a common block
name is mentioned in a SAVE statement, it must be mentioned in a SAVE
statement in each subprogram where it appears.

A SAVE statement is optional in a main program and has no effect.

SAVE statements cannot be used in procedures contained in executable
libraries.

          Examples                                     Notes 
--------------------------------------------------------------------------------------

SUBROUTINE matrix            The SAVE statement saves the values of a, b, and c, and
  :                          the values of all of the variables in the common block
SAVE a,b,c,/dot/             dot.
  :
RETURN

SUBROUTINE fixit             The SAVE statement saves the values of all of the
SAVE                         variables in the subroutine fixit.
  :
RETURN



MPE/iX 5.0 Documentation