IDL 8.x routine and save files not compatible with earlier versions of IDL
Topic
IDL 8.x SAVE files containing routines and system variables are not compatible with previous versions of IDL. On the other hand, SAVE files created from Variable Data will continue to be backward compatible with any older version of IDL.
While files containing IDL data variables can be restored by any version of IDL that supports the data types of the saved variables (in particular, by any version of IDL later than the version that created the SAVE file), files containing IDL routines and system variables can only be restored by versions of IDL that share the same internal code representation. Since the internal code representation changes regularly, you should always archive the IDL language source files (.pro files) for routines you are placing in IDL .sav files so you can recompile the code when a new version of IDL is released.
Discussion
IDL 8.x Language Changes
IDL 8.x has introduced important changes to its language. These changes have impacted the creation of SAVE files and their backward compatibility. Some of the main changes that are relevant to this new behavior are the inclusion of:
For example, the new calling syntax to methods (or the use of !NULL or Operator Overloading, to name a few) in IDL 8.x required changes in the compiler (more specifically, changes in the P-Code that the interpreter will then execute). These changes render the new SAVE file incompatible with earlier versions of IDL.
IDL 8.x Routine Save File Format Changes
If a user of a SAVE file created in IDL 8.x or greater tries to RESTORE it in an earlier version of IDL, he or she will find the following error message in the IDL console:
IDL> restore, 'draw_arrow.sav'
% RESTORE: Incompatible saved routine written by IDL version newer than this one not restored: DRAW_ARROW
The user will be able to check what version of IDL has created the SAVE file by using the following statements in the IDL command line:
IDL> osave = obj_new( 'idl_savefile', 'draw_arrow.sav' )
IDL> print, osave->Contents()
{draw_arrow.sav Portable (XDR) Thu Jul 15 16:29:06 2010 x86 Win32 8.0}
where "8.0" is the version of IDL where the SAVE file was created.
Using an IDL 8.x Routine Save File with an earlier version IDL Virtual Machine
If an IDL 8.x save file is used with an earlier version of the IDL Virtual Machine then, the IDL Virtual Machine session may generate an "Attempt to call undefined procedure/function" error such as:
Warning
The following error was encountered: Attempt to call undefined procedure/function: 'DRAW_ARROW'. Please consult the supplier of the application. |
where DRAW_ARROW is the procedure used in the above previous example.
Workaround
To workaround this issue, the developer of the SAVE file will need to be sure to create the application SAVE file with a compatible version of IDL.