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

Home » Public Forums » archive » Re: current directory
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: current directory [message #34284 is a reply to message #34283] Sun, 02 March 2003 06:48 Go to previous messageGo to previous message
Ulf-Dietrich Braumann is currently offline  Ulf-Dietrich Braumann
Messages: 3
Registered: March 2003
Junior Member
On Sat, 1 Mar 2003, David Fanning wrote:

> Ulf-Dietrich Braumann (braumann@izbi.uni-leipzig.de) writes:
>
>> Ok, the very scaring solution (which in fact also runs under IDL5.0)
>> comes here (just before I go home now ...):
>
> Wow. That could be useful. :-)
>
...
> Remember (those of you who faithfully update your
> IDL version), this requires the obsolete STR_SEP
> function. :-)

Well, due to a sudden ambition I just made a version
without STR_SEP, so here comes another unreadable, but
fairly compatible version :-)

PRO Tester
Help, Calls=callStack
thisRoutine = StrMid(callstack[0],0,StrPos(callstack[0]," "))
callingRoutine = StrMid(callstack[1],0,StrPos(callstack[1]," "))
Print, 'In ' + thisRoutine + ', which is called by ' + $
callingRoutine + '.'
thisRoutine = StrLowCase(thisRoutine) + '.pro'
thePath=StrMid(StrMid(callStack[0], 0, $
StrPos(callStack[0],thisRoutine)), $
StrPos(StrMid(callStack[0], 0, $
StrPos(callStack[0],thisRoutine)),'<')+1, $
StrLen(StrMid(callStack[0], 0, $
StrPos(callStack[0],thisRoutine))) - $
StrPos(StrMid(callStack[0], 0, $
StrPos(callStack[0],thisRoutine)),'<'))
Print, 'The file "' + thisRoutine + '" is in this directory: ' + thePath
END

which e.g. in my test prints out:

IDL> tester
In TESTER, which is called by $MAIN$.
The default path to tester.pro is: G:\


Greetings

Ulf-Dietrich Braumann, PhD
Interdisciplinary Centre for Bioinformatics
University of Leipzig
Kreuzstraße 7b
D-04103 Leipzig
Fed. Rep. of Germany
+49-341-1495114
[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
Read Message
Read Message
Previous Topic: Re: dynamically naming variables
Next Topic: dlm returning ptr array and string array

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

Current Time: Fri Oct 10 17:48:10 PDT 2025

Total time taken to generate the page: 0.96066 seconds