The .COMPILE command compiles and saves procedures and programs in the same manner as .RUN. .COMPILE is an executive command. Executive commands can only be used at the IDL command prompt, not in programs. If you specify one or more filenames, the procedures and functions contained therein are compiled, but are not executed. If you enter this command at the Command Line of the workbench and the files are not yet open, IDL opens the files within Editor windows and compiles the procedures and functions contained therein.
See RESOLVE_ROUTINE for a way to invoke the same operation from within an IDL routine, and RESOLVE_ALL for a way to automatically compile all user-written or library functions called by all currently-compiled routines.
If you specify the -f flag, File is compiled from the source stored temporarily in TempFile rather than on disk in File itself. This allows you to make changes to File (for example, in an IDL editor window), store the modified source into the temporary file (the IDL Workbench does it automatically), compile, and test the changes without overwriting the original code stored in File.
On UNIX systems, .COMPILE will interpret the $ (dollar sign) character as a reference to an environment variable and expand the variable as is normal for the operating system. To use a literal dollar sign in a filename, escape the $ character with a backwards slash character ( \$ ).
If you specify the -v flag, IDL will treat paths with $ in them as literal path names and not try to expand environment variables within the filepath.
.COMPILE [File1, ..., Filen]
.COMPILE -f File TempFile
.COMPILE -v /var/tmp/$HOME/mycode.pro