|
Application Programming: Creating and Running Programs in IDL |
|
Although any text editor can be used to create an IDL program file, the IDL Editor included in the IDL Development Environment contains features that simplify the process of writing IDL code. For example, if you indent a line using the Tab key, the following lines will be indented as well.
If you click the right mouse button while positioned over an editor window, a context menu appears allowing you to quickly access several of the most convenient commands. The context menu changes to display common debugging commands if IDL is running a program. When you create programs in the Editor window, you also have access to the following features:
If a program error or breakpoint is encountered, IDLDE displays the relevant file, opening it if necessary. The line at which the breakpoint or error occurred is marked. See Debugging and Error-Handling for more on IDL's debugging commands.
If you use the IDL Development Environment, files are opened in the IDL Editor by default. On UNIX platforms, you can simplify the process of using another editor; see Creating a Macro to Call a Text Editor in IDL for UNIX for details.
If you have a file open in the IDL Editor and you modify the file using another editor (on any platform), IDL will warn you that the file in the IDL Editor window has changed, and give you a chance to reload the file.
When you open a file in the IDL Editor, all functions and procedures defined in that file are listed in the Functions/Procedures Menu. On Windows, this feature appears as a pull-down menu located on the IDLDE toolbar. On Motif, this menu is accessed through the () button in the upper left corner of the Editor window.
Select a procedure or function from the drop-down list to move the cursor to the beginning of that procedure or function. This is especially useful for navigating large program files containing multiple procedures and functions.
The IDLDE provides methods to quickly comment and uncomment blocks of code lines. To comment or uncomment lines of code, you may either select the lines to be commented/uncommented or you may simply places the cursor somewhere on the desired line. Commenting and uncommenting can be performed using:
The IDL Editor window provides a comprehensive search-and-replace mechanism, allowing you to search for occurrences of a text string in one or more open files. See Search Menu for details.
Under Microsoft Windows, the IDL Editor provides three ways of selecting text: stream mode, line mode, and column mode.
Switch between the three modes by clicking the right mouse button while positioned over an Editor window. Select the "Selection Mode" option to access a pull-down menu with the three text selection modes. The option with a check mark by it is the currently selected text selection mode. If you have text already selected, the selected area will change to reflect the new mode.
The IDL Editor in IDL for Windows supports chromacoding — different types of IDL statements appear in different colors. To change the default colors used for different types of IDL statements, select File
Preferences, and select the Editor tab.
By default, the Windows IDL Editor uses chromacoding. To turn off chromacoding, select File
Preferences, select the Editor tab, and uncheck the Enable colored syntax checkbox. Alternately, you can specify a
The IDL Editor window supports a number of useful keyboard shortcuts, described in the following table.
| Note See Enabling Alt Key Accelerators on Macintosh for information on using keyboard accelerators on the Macintosh platform. |
IDL Online Help (March 06, 2007)