An Easier Way to Inspect Search Paths in IDL
Topic
IDL Search Paths can be extremely long. The traditional way to view this path is with the simple command:
As an example we are using in this article IDL 7.0, though this can be generalize to a later version of IDL as well. When a search path is long, this command produces relatively reader-unfriendly output like this:
C:\Program Files\ITT\IDL70\lib\bridges;C:\Program Files\IT
T\IDL70\lib\dicomex;C:\Program Files\ITT\IDL70\lib\hook;C:
\Program Files\ITT\IDL70\lib\imsl;C:\Program Files\ITT\IDL
70\lib\itools\components;C:\Program Files\ITT\IDL70\lib\it
ools\framework;C:\Program Files\ITT\IDL70\lib\itools\ui_wi
dgets;C:\Program Files\ITT\IDL70\lib\itools;C:\Program Fil
es\ITT\IDL70\lib\obsolete;C:\Program Files\ITT\IDL70\lib\u
tilities;C:\Program Files\ITT\IDL70\..., etc.
... and the IDL Workbench defaults to printing output like this all in one line!
This Help Article is designed to show both the command that can format the above output into this more reader-friendly layout:
C:\Program Files\ITT\IDL70\lib\bridges
C:\Program Files\ITT\IDL70\lib\dicomex
C:\Program Files\ITT\IDL70\lib\hook
C:\Program Files\ITT\IDL70\lib\imsl
C:\Program Files\ITT\IDL70\lib\itools\components
C:\Program Files\ITT\IDL70\lib\itools\framework
C:\Program Files\ITT\IDL70\lib\itools\ui_widgets
C:\Program Files\ITT\IDL70\lib\itools
C:\Program Files\ITT\IDL70\lib\obsolete
C:\Program Files\ITT\IDL70\lib\utilities
C:\Program Files\ITT\IDL70\ ..., etc.
... and how to set up your IDL Workbench, so that this command can be run with just a few keystrokes. This Help Article also shows the command for displaying the operating system $PATH environment variable in the same way.
Discussion
Below is the code command that will "pretty print" the value of your !PATH current IDL Search Path setting on any platform that IDL supports. The second line shows the small variation of that command that would print the operating system (or shell) $PATH environment variable inherited by IDL.
; Pretty print the IDL search path
print, strsplit(!PATH, path_sep(/SEARCH_PATH), /EXTRACT), $
FORMAT='(A)'
; Pretty print the operating system/shell path
print, strsplit(getenv('PATH'), path_sep(/SEARCH_PATH), $
/EXTRACT), FORMAT='(A)'
To take this Help Article one step further, however, we would like to show you how you could set up your IDL Workbench to provide this command whenever you want it in just a few keystrokes. We work off the concept of IDL Workbench "Templates", the instructions for which are discussed in more detail in Help Article #4297 ("Implementing "Macros" in the New IDL Workbench Development Environment").
To access Workbench templates, click on the IDL Workbench's 'Window->Preferences...' menu button and navigate to the 'IDL->Templates' page. Click on this page's 'New...' button and you get a dialog like the one below to work with. Notice the 'Name', 'Description' and 'Pattern' values we filled in. Probably it is just as well, also, that you uncheck the 'Automatically insert' checkbox.

Once you have saved this template, you have a very quick way to access these otherwise lengthy commands in your IDL developer session. Just enter at the IDL> command prompt Ctrl-spacebar (or, if you have many custom templates, 'P' followed by Ctrl-spacebar, and you will get a pop-up menu like the one shown below:

Use the Up/Down Arrow keys, or your mouse, to select the command you want to run and press 'Enter' to populate the IDL> command line. Add one more space character after the command line is populated before you press 'Enter' again. (This extra space is due to an unpredictable bug in the first version of the Workbench, which has subsequently been fixed.)