Super Quick Start

If you'd like to begin experimenting with the IDL Workbench right away, before reading any more, try the following things:

Quickly Display an Image

Open the examples.tif file from the IDL distribution:

  1. Click the folder_icon.gif icon or select File → Open File... to display the file selection dialog.
  2. Browse to the examples/data subdirectory of your IDL 7.1 installation.
  3. Select the file examples.tif.

Things to Notice

Quickly Create a Plot from an Existing Variable

You can use the Visualize perspective to quickly create a plot:

  1. Switch to the Visualize perspective by clicking the viz_perspective_button.gif icon in the upper right corner of the IDL Workbench.
  2. Click the folder_icon.gif icon or select File → Open File... to display the file selection dialog.
  3. Browse to the examples/data subdirectory of your IDL 7.1 installation.
  4. Select the file plot_data.sav.
  5. Notice that a new variable named PLOT_DATA appears in the Variables view. PLOT_DATA is a structure variable containing three vectors; click on the plus sign to the left of the variable name to see the individual vectors.
  6. Drag the variable TEMP1 from the Variables view to the Plot icon in the Tool Palette view. plot_tool_icon.gif

Things to Notice

Open a .pro File

Open the file xdice.pro from the IDL distribution:

  1. Switch to the IDL perspective by clicking the IDL_perspective_button.gif icon in the upper right corner of the IDL Workbench.
  2. Click the folder_icon.gif icon or select File → Open File... to display the file selection dialog.
  3. Browse to the examples/doc/widgets subdirectory of your IDL 7.1 installation.
  4. Select the file xdice.pro.

Alternately, click xdice.pro to open the file.

Things to Notice

Compile the .pro File

To compile the xdice.pro file, click the compile_icon.gif icon, press Ctrl-F8, or select Run → Compile xdice.pro.

Things to Notice

Run the Routine

To run the XDICE program, click the run_icon.gif icon, press F8, or select Run → Run xdice Alternately, enter xdice in the Command Line view.

Things to Notice

Close the .pro File

To close the file, click the X on the editor tab: editor_tab.gif. Alternately, press Ctrl-W, or select File → Close.

Create a New .pro File

To create a new .pro file, click the new_file_icon.gif icon or select File → New IDL Source File. A new editor window appears.

Paste the following text into the editor window:

PRO tinyRoutine 
; Create a string variable 
myString = 'This is a tiny IDL routine' 
PRINT, mystring 
; Create some other variables 
myNumber = 4 
myResult = STRING(myNumber * !PI) 
; Display the myResult variable 
void = DIALOG_MESSAGE('Result: '+myResult) 
END 

Things to Notice

Save the .pro File to a Project

By default, the IDL Workbench saves .pro files into a project stored in your workspace. (The contents of your workspace are displayed in the view.)

Unless you have renamed or removed it yourself, your workspace includes a project named "Default." To save your new .pro file, click the file_save_icon.gif icon or select File  Save. Because your new file has not been saved previously, the Save As dialog appears. Select "Default" as the parent folder and click OK, accepting the default filename (tinyroutine.pro).

Things to Notice

Set a Breakpoint

If you click the run_icon.gif icon, press F8, or select Run → Run tinyroutine you will notice that your new routine prints a string to the Console view, displays a dialog, and ends. If you wanted to temporarily stop execution of your routine somewhere in the middle, you would use a breakpoint.

To test the IDL Workbench breakpoint features:

  1. Position the cursor on the words PRINT, myString in the editor window.
  2. Press Ctrl-Shift-B or select Run → Toggle breakpoint. A blue dot appears in the left-hand margin of the editor window.

    Super_Quick_Start-15.jpg
  3. You can also toggle breakpoints on and off by double-clicking in the left-hand margin next to the line of code on which you want IDL to pause.

  4. Run the tinyroutine program again (press F8, click the run_icon.gif icon, or select Run → Run tinyroutine). If this is the first time you have run a program with a breakpoint (or an error), you will see the Confirm Perspective Switch dialog:

    perspective_switch_dialog.gif
  5. Click Yes to display the IDL Debug perspective. (To learn more about perspectives, see the Tour of the IDL Workbench Interface.) The IDL Workbench interface is rearranged to add several new views at the top of the screen: Debug, Variables, and Breakpoints.

    Notice that the Variables view contains entries for the four variables defined in the tinyroutine routine, but that only the MYSTRING variable is defined. It is also instructive to examine the contents of the Debug and Console views when IDL stops at a breakpoint.

  6. Press F6, click the stepover_icon.gif icon (on the toolbar in the Debug view), or select Run → Step Over. Note how Debug, Console, Variables, and Editor views adjust as you repeatedly step through your code.
  7. When you have stepped to the end of the tinyroutine (you will see the words % Stepped to: $MAIN$ in the Console view), click the IDL icon on the Perspective toolbar

    perspective_toolbar.gif
  8. to return to the IDL perspective.

Things to Notice

Edit and Save the .pro File

Modify the line in tinyroutine.pro that says myNumber = 4, replacing the 4 with some other number. The Editor tab displays an asterisk next to the file name to indicate that the file has been modified:

editor_tab_modified.gif

Click the file_save_icon.gif icon, press Ctrl-S, or select File → Save to save the change.

Things to Notice

Context-Sensitive Help

In the Editor view, hover the mouse pointer over the DIALOG_MESSAGE function. After a second, the following window appears:

hoverhelp.gif

This display (known as "hover help") shows you the syntax for the routine over which you are hovering.

Now click on the string DIALOG_MESSAGE so that the cursor is located somewhere within the string. Press F1 (Windows), Shift-F1 (Linux/Solaris), or the Help key (Macintosh). The full IDL help entry for the DIALOG_MESSAGE routine is displayed. (See Using IDL Help for an in-depth discussion of ways to display IDL help topics.)

Finally, begin a new line in the editor and type the following:

file = dialog 

Without moving the cursor from the end of the word "dialog", press Ctrl-space. The following window appears:

content_assist.gif

This display is known as "content assist." Use the arrow keys or a mouse to select DIALOG_PICKFILE() from the list, and the syntax and keywords for the DIALOG_PICKFILE function display. Press Enter and the function name is inserted into the editor window.

Further Reading

This section has introduced you to some of the most useful features of the IDL Workbench. To learn more, explore the IDL online help system. We suggest the following as topics to read early in your explorations: