X

Help Articles are product support tips and information straight from the NV5 Geospatial Technical Support team developed to help you use our products to their fullest potential.



6138 Rate this article:
No rating

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:

    IDL> print, !PATH

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.

PrettyPrintTemplate.png

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:

PrettyPrintCommandCompletion.png

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.)

Please login or register to post comments.
Featured

End-of-Life Policy Enforcement for ENVI 5.3 / IDL 8.5 and Earlier Versions

5/6/2024

April 1, 2024 Dear ENVI/IDL Customer,  We are reaching out to notify you of our supported... more »

How to Upgrade licenses to ENVI 6.x / IDL 9.x

12/5/2023

What is the new Upgrade function? Starting with ENVI 6.0 and IDL 9.0, we have implemented an... more »

What to do if the 'License Administrator - License Server' for the Next-Generation License Server does not start?

6/13/2023

Background: With the release of ENVI 5.7 & IDL 8.9 and the corresponding Next-Generation licensing... more »

Next-Generation Licensing FAQ

4/28/2023

  NV5 Geospatial has adopted a new licensing technology for all future releases of our ENVI, IDL... more »

The IDL Virtual Machine

6/6/2013

What is the IDL Virtual Machine? An IDL Virtual Machine is a runtime version of IDL that can... more »