Home | Categories | Alphabetical | Classes | All Contents | [ < ] | [ > ]

Overview


In addition to being a useful interactive data analysis tool, IDL is a powerful programming language. Many of IDL's programming language features and constructs can be used either interactively at the IDL command line or as part of a larger program - which can itself be invoked at the IDL command line or by other programs.

IDL programs can take any of the following forms:

Batch Files

A batch file contains one or more IDL statements or commands. Each line of the file is read and executed before proceeding to the next line. This makes batch files different from main-level programs, which are compiled as a unit before being executed, and program files, in which all modules contained in the file are compiled as an unit before being executed. A file created by the JOURNAL routine is an example of a batch file. See Executing Batch Jobs in IDL for additional information on batch files.

Note
Batch files are sometimes referred to as include files, since they can be used to "include" the multiple IDL statements contained in the file in another file.

Main-Level Programs

Short programs or procedures are often be entered at the IDL command line. These main-level programs consist of a series of program statements that are compiled and executed once an END statement is encountered. Main-level programs are not explicitly named, and cannot be called from other programs. For more information on main-level programs, see Main-Level Programs.

Named Programs

Longer routines and programs, consisting of more than a few lines, are typically given their own explicit names, allowing them to be called from other programs as well as executed at the IDL command line. Named programs are stored in disk files created using a text editor. The graphical IDL Development Environment includes a built-in text editor, but any text editor can be used to create named IDL programs. Files containing IDL programs, procedures, and functions are assumed to have the filename extension .pro.

See Running IDL Programs for the methods used to execute program files. For more detailed information on IDL program files, see What is an IDL Program?.

SAVE Files

You can create binary files containing data variables, system variables, functions, procedures, or objects using the SAVE procedure. Named IDL programs can be stored in SAVE files and distributed to other IDL users, who will be able to execute the program but who will not have access to the IDL code that creates it. For information on running IDL routines stored in a SAVE file, see Executing Programs Stored in a SAVE File. For information on storing a program in a SAVE file, see Saving Compiled IDL Programs and Data.

Other common uses for SAVE files include:


Home | Categories | Alphabetical | Classes | All Contents | [ < ] | [ > ]