The 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.
Set this keyword to save all common blocks, system variables, and local variables from the current IDL session.
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
idlsave.dat
is used.
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.
CAUTION: 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.
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: