Re: Locating IDL source code file [message #44417 is a reply to message #44416] |
Tue, 14 June 2005 05:25  |
R.Bauer
Messages: 1424 Registered: November 1998
|
Senior Member |
|
|
Craig wrote:
> [copied over from comp.lang.idl - don't know how to properly cross-post
> it in retrospect using Google groups]
>
>
> Hi all,
>
> I'm trying to write some code that will read information (like version
> numbers and dates) from the source files for procedures and functions
> that it uses. In Matlab I would use a command like
>
>
>>> which fred
>
>
> to return the full path to the source file "fred.m". How do I get the
> same result from IDL v6.1? I've tried something like
>
> IDL> ttt = file_which('fred.pro', /include_current_dir)
could be done in several ways
* if it is compiled, help,/source,out=out
* look for "current directory" or "get_profile_path" in the google forum or
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_source/idl _html/dbase/get_profile_path_dbase.pro.html
* file_which if the routine is in !PATH
>
> but just got a null string returned. This might be because I'm using
> the IDLDE, so the routine isn't actually on the search path !PATH, even
> though it has been compiled OK when building the project.
you should think on using a startup script which organises the !path for
you. A startup file is used in idlde and idl the same way. just only an
environement variable IDL_STARTUP must be set to this file.
>
> Once this problem is solved, I'll also need to determine the filename
> for the source file containing a definition of 'fred', because most of
> the routines in this project don't have their own 'fred.pro' source
> file.
Then you want to separate between path file and extension.
you should have a look at:
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_source/idl _html/dbase/file_path_name_ext_dbase.pro.html
cheers
Reimar
--
Reimar Bauer
Institut fuer Stratosphaerische Chemie (ICG-I)
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
------------------------------------------------------------ -------
a IDL library at ForschungsZentrum Juelich
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_lib_intro. html
============================================================ =======
|
|
|