Coyote's Guide to IDL Programming

Setting Up Your IDL Workbench

QUESTION: Now that IDL 7.0 has been released and installed on my PC, I'd like to know how a curmudgeon like me can actually use all this project and workspace stuff.

I never did come to terms with IDL projects, on the theory that if I ignored them they might go away. (And they did!) I have all the IDL code I've written in the last 14 years organised (I'm using the word loosely) in a single directory tree that contains 7196 files totalling 60.1 MB in 203 subdirectories, nested a few deep. There is a sort of a pattern to these subdirectories: some of them are specific to a particular work project, some are routines for general consumption. The routines are pretty promiscuous about calling each other, so pulling out a specific routine and resolving all its dependencies is not easy (and why should it be, as I never do it?).

I now have a directory called IDLWorkspace/Default with just one file in it called .project. I have my existing directory tree elsewhere and I have modified my !PATH to point to it. What should I do now? Ignore the new projects and workspaces and hope they go away?

ANSWER: As the little book I picked up at the IDL User's Group meeting put it so elequently, “Don't Panic!!”. Here is some advice from Chris Torrance that he offered to the IDL Newsgroup.

I think that what you describe is pretty typical for most users, so don't despair. The problem with the old DE was that its projects didn't necessarily have anything to do with the files as they existed out on disk. You could have a project with files, each of which came from a different location on your hard drive. The old projects were really only useful for creating save files, not for maintaining organization.

With the new IDL Workbench, there is a single Workspace, as you describe. (You can have more than one Workspace, but let's ignore that for now.) The Workspace contains multiple projects. A project is simply a collection of files and folders, that is laid out exactly as they exist on your drive. These files and folders have to all reside within a Project folder, which can be located either within your Workspace or in a separate location.

Here is what I would recommend:

  1. See if you can organize your 203 directories into a few logical high-level directories. It sounds like you might already have it organized this way.
  2. Use the New IDL Project wizard to import these high-level directories into your Workspace, with one project per directory.
    • Fire up the New IDL Project wizard (via the File->New->IDL Project or from the Toolbar button)
    • Give your project a name, e.g. “Work Project 1,” “Utilities,” etc.
    • For Location, choose Create the new project from an existing directory, and choose your desired directory to import.
    • Since you are managing the path yourself, be sure to deselect the Update IDL path preference toggle.
    • Once you hit Finish, your new Project will get created. Note that the files are still in their original locations - they are not copied. But now the Workspace contains a new Project that contains a reference to all of the files and folders within that subdirectory.
  3. Now... try something cool like Search (Ctrl+H) across multiple files. Or try Ctrl+Shift+R, to bring up the Open Resource dialog. Then start typing the name of one of your files, to quickly locate it. Or you can do things like use "; TODO" markers in your IDL comments.

To this, I would add one more essential tip. Read this article on how to set up Perspectives in the IDL Workbench to make your life a lot easier.

Having fooled around with just about every possible wrong way to set up my IDL Workbench in the past two weeks, I have written a short IDL/Subversion Set-Up Guide that talks about how to convert your current IDL directory structure into one that accommodates the Eclipse-based project method required by the IDL Workbench. Moreover, if you are working on a Windows computer, this step-by-step guide to setting up a Subversion software version control system will save you hours of time and frustration.

Google
 
Web Coyote's Guide to IDL Programming