Running Named Programs
IDL program files, identified with a .pro extension, can be compiled and executed using the following methods:
Running Programs Using the IDL Workbench Interface
To run an IDL program using the IDL Workbench interface, do the following:
- Open the file in the IDL Editor. For example, select:
File → Open File - Compile the file by selecting Run → Compile filename
- Execute the file by selecting Run → Run filename
and select examples/demo/demosrc/d_uscensus.pro from your IDL installation directory.
where filename is the name of the file opened in the IDL Editor (d_uscensus.pro, in this example).
where filename is the name of the file opened in the IDL Editor (d_uscensus.pro, in this example).
Running Programs From the IDL Command Line
When a file is specified by typing only the filename at the IDL prompt, IDL searches the current directory for filename.pro (where filename is the file specified) and then for filename.sav. If no file is found in the current directory, IDL searches in the same way in each directory specified by !PATH. If a file is found, IDL automatically compiles the contents and executes any functions or procedures that have the same name as the file specified (excluding the extension). See Automatic Compilation for additional details.
Using the previous example, run the US Census Data demo by entering the following at the command line:
Running Programs Using Executive Commands
When a file is specified using either the .RUN, .RNEW, .COMPILE, or @ command followed by the filename, IDL searches the current directory for filename.pro (where filename is the file specified) and then for filename.sav. If no file is found in the current directory, IDL searches in the same way in each directory specified by !PATH. If a file is found, IDL compiles or runs the file as specified by the executive command used. Executive commands can be entered only at the IDL command prompt, and are often used when executing $MAIN$ program files. See About Executive Commands for more information.
Note
If you are compiling files that do not exist in your path, make sure to compile functions before procedures. This keeps IDL from misinterpreting a function call as a subscribed variable or array definition. See Compiling Your Program for details.
Warning
If the current directory contains a subdirectory with the same name as filename, IDL will consider the file to have been found and stop searching. To avoid this problem, specify the extension (.pro or .sav, usually) when entering the run, compile, or batch file executive command.
The details of how !PATH is initialized and used differ between the various operating systems, although the overall concept is the same. See !PATH (IDL Reference Guide) for more information.