Re: file paths [message #8560 is a reply to message #8559] |
Thu, 03 April 1997 00:00   |
David Foster
Messages: 341 Registered: January 1996
|
Senior Member |
|
|
David wrote:
>
> hi,
>
> I want to add some code at the top of a fairly large project that will
> tell IDL where to look for all the subroutines it'll need. They are in
> various different folders, organized by their function. I want the code
> to compile everything automatically, even if I move the source around.
> (It would be messy to put all the subroutines in the same folder).
>
> Is there any way other than help, /source to show the path of the
> currently executing file? If I knew the path to the executing file, I
> could append it (with a +) to !path to make this work, right?
>
Maybe I'm really missing the boat on this one, but I think you would
be better off organizing your source code so that everything is
included in your definition of !PATH from the start. Part of the
beauty of IDL is that you don't have to tell it where to find
routines. Once you do this, you can pre-compile routines in an
application by just using:
@filename.pro
If you really need to add dirs to !PATH "on the fly", I like
Tim's approach using getenv() (maybe just once though!).
I don't understand the last statement, since if a file is executing
then IDL must have found it, which means that it's directory
is *already* in !PATH.
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
David S. Foster Univ. of California, San Diego
Programmer/Analyst Brain Image Analysis Laboratory
foster@bial1.ucsd.edu Department of Psychiatry
(619) 622-5892 8950 Via La Jolla Drive, Suite 2200
La Jolla, CA 92037
[ UCSD Mail Code 0949 ]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
|
|
|