SAVE procedure saves variables, system variables, and IDL routines in a file using the XDR (eXternal Data Representation) format for later recovery by RESTORE. Note that variables and routines cannot be saved in the same file. Note also that save files containing routines may not be compatible between different versions of IDL, but that files containing data are always backwards-compatible.
, ..., Var
Optional named variables that are to be saved.
Set this keyword to save all common blocks, system variables, and local variables from the current IDL session.
Routines and variables cannot be saved in the same file. Setting the ALL keyword does not save routines.
Set this keyword to save all main level common block definitions. Note that setting this keyword does not cause the contents of the common block to be saved unless the VARIABLES keyword is also set.
A string containing the name of the file into which the IDL objects should be saved. If this keyword is not specified, the file
Set this keyword to save user defined procedures and functions in a machine independent,
binary form. If parameters are present, they must be strings containing the names of the procedures and/or functions to be saved. If no parameters are present, all compiled routines are saved. If you are using VMS, see the XDR keyword below. Routines and variables cannot be saved in the same file.
Because SAVE stores routines in a binary format, save files containing routines are not guaranteed to be compatible between successive versions of IDL. You will not be able to RESTORE save files containing routines if they are made with incompatible versions of IDL. In this case, you should recompile your original code with the newer version of IDL. Save files containing data will always be restorable.
Set this keyword to save the current state of all system variables.
Saving system variables is not recommended, as the structure may change between versions of IDL.
Set this keyword to save all variables in the current program unit. This option is the default.
Set this keyword to print an informative message for each saved object.
This keyword is obsolete and will be quietly ignored (there is no need to remove uses of the XDR keyword from existing code). IDL always generates XDR format files, although it will continue to read VAX format SAVE files generated by old versions of VMS IDL.
Save the status of all currently-defined variables in the file variables1.dat by entering:
SAVE, /VARIABLES, FILENAME = 'variables1.dat'
The variables can be restored with the RESTORE procedure. Save the user procedures MYPROC and MYFUN:
SAVE, /ROUTINES, 'MYPROC', 'MYFUN'