Creating Application SAVE Files
An IDL application created in IDL 6.0 or later that does not use the EXECUTE function can be saved in one or more SAVE files that will run in the IDL Virtual Machine. If an IDL application is to be run in the IDL Virtual Machine, it is not necessary to include an IDL distribution with the SAVE file because IDL Virtual Machine is installed on the user's machine. The SAVE file need only include your own code, creating a smaller file that is easier to distribute.
To create SAVE files to run in the IDL Virtual Machine, do one of the following:
- Create SAVE files from one or more compiled
.profiles with the SAVE procedure. See Creating SAVE Files of Program Files for details, and refer to "SAVE" (IDL Reference Guide). - Create SAVE files from a project by selecting Project → Export with the Save File (.sav) option specified.
Note
Creating SAVE files of object-oriented programs requires the use of RESOLVE_ALL with the CLASS keyword.
Single vs. Multiple SAVE Files
There are several ways to include the necessary routines in your application:
- For a native IDL application, include all routines in the main SAVE file that is restored when your application is started. This makes all routines available without having to restore any additional SAVE files, and reduces the number of SAVE files used by your application. The easiest way to do this is to add all
.profiles to a project, and build the project. - Create a separate SAVE file containing all your routines. You might use this method for a Callable application, if you want to keep certain routines separate from your main SAVE file in a native IDL application, or if your application includes routines provided to you as a SAVE file by another developer. To run any routines included in this SAVE file, you must restore the SAVE file by either calling a routine with the same name as the
.savfile or restore it explicitly using RESTORE. - Create a separate SAVE file for each routine used by your application. Assuming each
.savfile uses the same name as the procedure or function it contains, this allows you to call each routine without having to explicitly restore its SAVE file because IDL will search the current directory and the defined !PATH for the.savfile and restore it automatically when it encounters the first call to the routine.
Version Compatibility of SAVE Files
The IDL Virtual Machine will execute IDL routines stored in SAVE files created with IDL version 6.0 and later. Any SAVE files created with previous versions of IDL must be recompiled using IDL 6.0 or later for them to run with the Virtual Machine.