|
Getting Started with IDL: Programming in IDL |
|
The IDL Development Editor (IDLDE) offers you the ability to program applications with ease. The term "IDL Application" is used very broadly and any program written in the IDL language is treated as an IDL application. IDL applications range from the very simple (for example, a MAIN program entered at the IDL command line) to the very complex (for example, large programs with graphical user interfaces). Whether you are writing a small program to analyze a single data set or a large-scale application for commercial distribution, it is useful to understand the programming concepts used by the IDL language. IDL even allows you to call IDL from other programs written in other languages and call other programs from IDL.
The IDL Editor is a programmer-style editor. For example, some characteristics include:
A thorough listing of IDL Editor window key definitions is given in Editor Window Keyboard Shortcuts.
The Windows IDL Editor supports chromacoding — the automatic coloring of different types of IDL statements. Select File
Preference and choose the Editor tab to display the colors used for different types of entries recognized by IDL.
There are multiple ways of executing a program within IDL. These involve varying levels of complexity and include:
A main program unit consists of a sequence of IDL statements that end in an END statement. Only one main program unit may exist within an IDL project window at any time. All commands (except executive statements) that can be entered at the IDL Command Line can also be contained in an IDL program.
A procedure is a self-contained sequence of IDL statements that performs a well-defined task. A procedure is identified by a procedure definition statement where the procedure name is the name of the IDL statement you are creating and the parameters are named variables that are used in the procedure.
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. All functions return a function value which is given as a parameter in the RETURN statement used to exit the function.
See Overview of IDL Program Types for more information.
The compound statements in IDL are:
The conditional statements in IDL are:
The loop statements in IDL are:
The jump statements in IDL are:
| Note For more detailed information about the functions of these IDL statements, see Program Control. |
IDL Online Help (March 06, 2007)