IDL Workbench Enhancements
The IDL Workbench is a graphical interface to IDL that provides powerful code development and debugging tools in a cross-platform interface that looks and behaves the same way on all platforms supported by IDL.
See Welcome to the IDL Workbench in the IDL help system for an introduction.
The following enhancements have been made to the IDL Workbench for the 7.1 release:
New Visualize Perspective
IDL 7.1 introduces the Visualize Perspective. The Visualize Perspective is an IDL Workbench perspective that is designed for quick and easy visualization of data contained in files or IDL variables.
Tip
The Visualize Perspective will be shown automatically when you first launch IDL 7.1. To use the IDL perspective familiar from IDL 7.0, simply click the IDL button in the upper right corner of the IDL Workbench.
The Visualize Perspective allows you to quickly create visualizations from your data by dragging IDL variables from the Variables view to a set of action bars contained in the new Visualization Palette view.
For more information, see the Visualize Perspective topic in the IDL Online Help.
Automatic Data Import
The IDL Workbench's File → Open File... menu item has been enhanced to automatically import data from files of known data types. When you select a file by using this menu item, IDL will attempt to read the file and create IDL variables for the data contained therein. Depending on the type of file you select, IDL will either read the contents automatically or prompt you for additional information on how to import the data.
You can use the same automatic data import mechanism programmatically with the new IOPEN routine. See IOPEN Routine for Automatic Data Import for details.
Enhanced Handling of IDL SAVE Files
In IDL 7.0, opening an IDL SAVE file (.sav) using the File → Open File... menu item (or by double-clicking on the .sav file in the Project Explorer) caused IDL to attempt to restore and execute an application contained in the file. Selecting a SAVE file containing variables caused IDL to generate an "Attempt to call undefined procedure or function" error.
Beginning in IDL 7.1, using either the File → Open File... menu item or the IOPEN routine to open a .sav file that contains variables will automatically restore the variables in IDL's current scope. Opening a .sav file containing routines will continue to attempt to restore and execute an application contained in the file.
Custom Workbench File Readers
If you have a file reader routine designed to import data from files in a custom data format, you can configure the IDL Workbench to recognize those files and perform automatic data import when they are selected. See the Adding Custom File Readers topic in the IDL Online Help for details.
Automatic Path Management Enhancements
Note
This enhancement was released as part of the IDL Workbench 7.0.3 update. If you installed that update, you will not see any additional change in behavior in IDL 7.1.
The introduction of the IDL Workbench and workbench projects in IDL 7.0 brought with it the concept of automatic path management. Automatic path management means that, for workbench projects that you specify, the workbench will ensure that the project directory is on IDL's search path when the project is open. Automatic path management is explained in detail in the IDL Path Management topic in the IDL Online Help.
In the IDL 7.0 Workbench, changes to IDL's path were effected by changing the IDL_PATH preference. While this ensured that workbench projects were available both when the IDL Workbench was running and when IDL was used in command line or runtime mode, it had the side effects of resetting the value of the !PATH system variable and the IDL_PATH preference whenever the IDL Workbench updated the path.
Key Changes
The key things to understand about the changes to IDL's automatic path management are:
- The IDL Workbench no longer changes the value of the IDL_PATH preference.
- The IDL Workbench no longer overwrites the value of the !PATH system variable. If you change the value of the !PATH system variable, the IDL Workbench will add entries for managed projects at the end of the path specification as described below, but it will not remove any entries.
- If a workbench project has the Update IDL path when project is opened or closed preference set, the project is considered to be a managed project. For managed projects:
- If the managed project is open, the IDL Workbench will ensure that the project directory (including any subdirectories) is included in the list of directories specified by the !PATH system variable. If the directory is not present in !PATH, it will be added at the end of the path specification.
- If the managed project is closed, the IDL Workbench will remove the project directory from the list of directories specified by the !PATH system variable unless the project directory is also specified by the IDL_PATH preference.
Ensuring your Path Preference is Correct
Prior to the IDL Workbench 7.0.3 update, the workbench modified the value of the IDL_PATH preference with each change to a managed project. As a result, the value of the IDL_PATH preference may include directories you do not wish included. To clean up your IDL_PATH preference, ITT Visual Information Solutions suggests that you do the following after installing IDL 7.1 if you previously installed IDL 7.0 but not the IDL Workbench 7.0.3 update:
- Open the IDL Paths preferences page and Remove any managed directories from the list. Note that your IDL_PATH preference should contain, at a minimum, the
<IDL_DEFAULT>entry. - Apply the changes and exit IDL.
- Restart IDL and open the IDL Paths preferences page to ensure that the IDL_PATH preference contains only directories you have specified.
- At the IDL Command Line, enter
PRINT, !PATH
and confirm that the directories for any managed projects appear at the end of the path specification.
What the Changes Mean to You
If you do not manually alter the values of the !PATH system variable or the IDL_PATH preference, or use the contents of managed IDL Workbench project directories from command-line IDL sessions, you should see no change in IDL's behavior.
If you want directories corresponding to managed IDL Workbench projects to be available in IDL's path when you are using IDL in command line mode (that is, when the IDL Workbench is not running), you must add the directories to the IDL_PATH preference manually. You can manage the IDL_PATH preference using either the IDL Paths preferences page in the IDL Workbench or the PREF_SET routine.
Similarly, if you want to control the exact location of a managed IDL Workbench project's directory in the !PATH specification, you must add the project directory to the IDL_PATH preference in the desired location. Note that managed project directories added to the IDL_PATH preference are not removed from !PATH when the project is closed. If you wish to change the directory's position in the !PATH specification temporarily, you can simply modify the value of the !PATH system variable.
IDLdoc Integration
Note
This enhancement was released as part of the IDL Workbench 7.0.3 update. If you installed that update, you will not see any additional change in behavior in IDL 7.1.
IDLdoc is a third-party, open source text format used within the comment sections of an IDL .pro file. The IDLdoc format allows code comments to be exploited for other purposes, including generating formatted user documentation (similar to JavaDoc), and creating formatted hover help displays for user-written IDL routines.
Michael Galloy, the creator of IDLdoc, maintains a website to facilitate its exposure and distribution within the IDL community:
For information on how the IDL Workbench uses IDLdoc-style comments, see the Advanced Code Commenting with IDLdoc topic in the IDL Online Help.
Hover Help
The IDL Workbench already contains the Hover Help feature, in which comments located above an IDL procedure are displayed in a small popup window. IDL's comment extraction utility has been enhanced to convert IDLdoc-style comments into HTML that is optimized for viewing within a small Hover Help popup.
IDLdoc Comment Blocks
The IDL Workbench now includes two default IDLdoc comment blocks that help reduce the work required to use IDLdoc. The Routine template creates a code block for a procedure or function, and the File template creates a code block for an entire .pro file. These templates are accessed through the IDL → IDLdoc preferences page, and you can customize them with your own text and variables.
Command Line View Enhancements
The IDL Workbench Command Line View has been enhanced in the following ways:
- A toolbar button on the view toolbar allows you to clear the text from the command line.
- A toolbar button on the view toolbar allows you to perform a reset or full reset of the IDL session (equivalent to issuing the .RESET_SESSION or .FULL_RESET_SESSION executive commands).
- You can drag a variable name from the Variables view directly to the Command Line view.
See Command Line View for additional details.
Variables View Enhancements
The IDL Workbench Variables View has been enhanced in the following ways:
- You can delete one or more variables from the IDL $MAIN$ scope by clicking on a toolbar button on the view toolbar, selecting an item from the view menu, or selecting an item from the context menu.
- You can rename a variable by selecting an item from the view menu or from the context menu.
- You can change the value of a scalar variable by selecting an item from the view menu or from the context menu.
- You can drag variable names from the Variables view to the Command Line view, an editor window, or the Visualize Perspective's Tool view.
See Variables View for additional details.
Miscellaneous IDL Workbench Features
Note
These enhancements were released as part of the IDL Workbench 7.0.3 update. If you installed that update, you will not see any additional change in behavior in IDL 7.1.
Execute Selected Code from the Editor
You can execute a block of .pro code that is highlighted in the IDL Workbench editor. After selecting the code block, either select Run → Run Selected Text or right-click and select Run Selected Text.
Open Declarations for Object Self Methods
When using the self syntax for referencing object methods, you can immediately display a method declaration inside the .pro editor.
Consider the following code block:
oTile = self->CreateIterator(/SPATIAL, $ MASK=oMask, $ SUB_RECT=subRect, $ BANDS=bands, TILE_DATA_TYPE=4, $ OVERLAP=yDim, /INVERSE_MASK)
Click inside CreateIterator, right-click, and select Open Declaration from the context menu. The editor will jump to the class' CreateIterator() method declaration.
Note
The self method declaration feature only works if the method is written in .pro code. Methods for built-in classes cannot be queried in this way.
New Formatter Preferences Page
The Formatter preferences page has been created to control the format of IDL code elements for the content assist and code formatting features. Some of these preferences were previously located on the IDL → Editor preferences page.
On this preferences page, you can change the appearance of code elements such as reserved words, system routines, keywords, and so on.
Highlight Selected Words in Editor
On the Editor preferences page, you can choose to highlight other occurrences of the currently-selected word or words in the active editor. You can toggle between all the highlighted words by selecting Occurrences from the Next Annotation or Previous Annotation menu on the Workbench toolbar, and clicking Next Annotation or Previous Annotation.
IDL Reserved Words Added to Content Assist
The Content Assist feature now includes IDL reserved words as selectable options.
Expandable Comment Sections
For source code files that are included in an IDL project, the IDL Workbench editor now recognizes comment blocks, and allows you to expand or collapse them with a button in the left margin.

Expandable comment sections are enabled by default; to turn them off or back on, right-click in the grey bar at the left edge of the editor window and select Enable Folding from the Folding... sub-menu.
Command Line Parenthesis/Bracket Matching
In the IDL command line, you can place the cursor to the right of a parenthesis, brace, or bracket, and the matching symbol is highlighted. This new functionality mirrors the parenthesis/bracket matching feature that already exists in the IDL Workbench editor.
