The RESTORE procedure restores the IDL variables and routines saved in a file by the SAVE procedure.
RESTORE provides a very simple interface that restores the entire contents of the specified SAVE file in a single atomic operation. If you wish to query the contents of a SAVE file without first restoring the data, or if you wish to restore only selected items, use the interface provided by the IDL_Savefile object class instead.
.profiles) for routines you are placing in IDL
.savfiles so you can recompile the code when a new version of IDL is released.
RESTORE [[, Filename] | [, FILENAME=name]] [, DESCRIPTION=variable] [, /RELAXED_STRUCTURE_ASSIGNMENT] [, RESTORED_OBJECTS=variable] [, /VERBOSE]
A scalar string that contains the name of the SAVE file to be restored. If Filename is not an absolute path name, it is considered to be relative to the current working directory. If neither the Filename argument or the FILENAME keyword are present, IDL attempts to restore a file named
idlsave.dat in the current working directory.
Set this keyword equal to a named variable that will contain the user-supplied description string for the specified save file. If no description was provided when the save file was created (via the DESCRIPTION keyword to the SAVE routine), the variable specified by this keyword will contain a null string.
This keyword serves exactly the same purpose as the Filename argument-only one of them needs to be provided. If both the Filename argument and the FILENAME keyword are provided, the file specified by the Filename argument is restored.
Normally, RESTORE is unable to restore a structure variable if the definition of its type has changed since the SAVE file was written. A common case where this occurs is when objects are saved and the class structure of the objects change before they are restored in another IDL session. In such cases, RESTORE issues an error, skips the structure, and continues restoring the remainder of the SAVE file.
Setting the RELAXED_STRUCTURE_ASSIGNMENT keyword causes RESTORE to restore such incompatible values using "relaxed structure assignment," in which all possible data are restored using a field-by-field copy. (See the description of the STRUCT_ASSIGN procedure for additional details.)
Set this keyword equal to a named variable that will contain an array of object references for any objects restored. The resulting list of objects is useful for programmatically calling the objects' restore methods. If no objects are restored, the variable will contain a null object reference.
Set this keyword to have IDL print an informative message for each restored object.
Suppose that you have saved all the variables from a previous IDL session with the command:
SAVE, /VARIABLES, FILENAME = 'session1.sav'
If the file
session1.sav is located in your current working directory, the variable associated with the file can be restored by entering:
DESCRIPTION keyword: 6.1
JOURNAL, SAVE, STRUCT_ASSIGN, IDL_Savefile