Batch File Execution
You can run IDL in non-interactive mode (batch mode) by entering the character @ followed by the name of a file containing IDL executive commands and statements. Commands and statements are executed in the order they are contained in the file, as if they had been entered at the IDL command prompt.
Batch execution can be terminated before the end of the file, with control returning to interactive mode without exiting IDL, by calling the STOP procedure from the batch file. Calling the EXIT procedure from the batch procedure has the usual effect of terminating IDL.
Executing a Batch File
To execute a batch file, enter the name of the file, prefaced with the "@" character, at the IDL prompt:
where batchfile is the name of the file containing IDL statements. Note that the @ symbol must be the first character on the line in order for it to be interpreted properly.
Note
This syntax can also be used within an IDL program file.
The cntour01 batch file contains the following lines:
; Restore Maroon Bells data into the IDL variable "elev". RESTORE, FILEPATH('marbells.dat', SUBDIR=['examples','data']) ; Make the x and y vectors giving the column and row positions. X = 326.850 + .030 * FINDGEN(72) Y = 4318.500 + .030 * FINDGEN(92).
Enter the following at the IDL command line to execute the batch file:
IDL reads statements from the specified file until the end of the file is reached. Variables ELEV, X, and Y appear in the variable watch window. Batch files can also be nested by placing a call to one batch file within another. For example, the surf01 batch file calls the cntour01 batch file and uses the variable data to create a surface display. To see the results, enter the following at the command line:
Naming and Locating Batch Files
If filename does not include a file extension, IDL searches the current working directory and the directories specified by the !PATH system variable for a file with filename as its base, with the file extension .pro. If filename.pro is not found in a given directory, IDL searches for filename with no extension in that directory. If filename is found (with or without the .pro extension), the file is executed and the search ends. If filename includes a full path specification, IDL does not search the directories in !PATH.