About 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 IDL Workbench 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.
Note
Although any text editor can be used to create an IDL program file, the IDL Editor contains features that simplify the process of writing IDL code. See Command Line Tips and Tricks for details on using the IDL Editor.
Most IDL applications consist of one or more IDL procedures, functions, object definitions, and object method routines:
- Procedures — a procedure is a self-contained sequence of IDL statements with a unique name that performs a well-defined task. Procedures are defined with the procedure definition statement,
PRO. - Functions — a function is a self-contained sequence of IDL statements that performs a well-defined task and returns a value to the calling program unit when it is executed. Functions are defined with the function definition statement FUNCTION.
- Object definitions — an object definition describes an IDL object, which can encapsulate both instance data and method routines. For additional information on IDL's object-oriented programming features, see The Basics of Using Objects in IDL (Object Programming).
- Object methods — these routines are procedures and functions that act on object instance data. See Acting on Objects Using Methods (Object Programming) for additional information.
See the following section for a simple procedure that calls a function. See Creating Procedures and Functions for details on creating and calling procedures and functions, defining argument and keyword parameters, and using keyword inheritance.
Note
See Library Authoring for information on procedure naming.