comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: path to .sav file
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: path to .sav file [message #50911 is a reply to message #50909] Mon, 23 October 2006 13:22 Go to previous messageGo to previous message
JD Smith is currently offline  JD Smith
Messages: 850
Registered: December 1999
Senior Member
On Mon, 23 Oct 2006 10:27:46 -0600, David Fanning wrote:

> David Fanning writes:
>
>> Indeed. As either of those two programs would prove to you. :-)
>
> Some people just insist on using one well-named program
> when 8-10 lines of code would do just fine. As Coyote
> says, "It's a damn commie plot!"

Looks like 1 line to me ;). I use a modification of this method: create a
little batch file (e.g. project_directory.pro) with something like:

common my_project_dir, proj_dir
if n_elements(proj_dir) eq 0 then begin
resolve_routine,'myproj',/NO_RECOMPILE
proj_dir=(routine_info('myproj',/SOURCE)).PATH
ps=path_sep()
if strmid(proj_dir, 0,1) ne ps then $ ;relative filename
proj_dir=file_expand_path(proj_dir)
endif

Then in any routine where you need to know the project directory, just

@project_dir

at the top. More real world examples would locate the interesting
relative paths within the distribution. You can use anything for
'myproj', just pick a routine which is in a known useful location. This
works for source, compiled SAV's, anything. For maximum usefulness, have
the relative location of the routine (in source distributions) and the
.sav file (in binary distributions) the same.

JD
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Retrieving the title of a widget_base after the fact.
Next Topic: sorting string arrays - non alphabetic and user defined order

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 19:29:31 PDT 2025

Total time taken to generate the page: 0.00523 seconds