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 #34285 is a reply to message #34284] Sun, 02 March 2003 00:27 Go to previous messageGo to previous message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
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. :-)
>
> Here is the program stripped of some control characters
> that got embedded somehow when you sent it:

Here is an other version to make it more readable.

I like using functions to get code more readable.
within brackets is a routine which could solve a lot of extraction problems.
one other is within_delimiter which you find in the library too

file_path_name_ext is used to extract from a given file location it's path
it's name and it's extension.


http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_source/idl _html/dbase/download/within_backets.tar.gz
or as idl binary
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_source/idl _html/dbase/download/within_brackets.sav

http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_source/idl _html/dbase/download/file_path_name_ext.tar.gz
or as idl binary
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_source/idl _html/dbase/download/file_path_name_ext.sav



PRO Tester
Help, Calls=callStack
r=within_brackets(callStack[0],brackets=['<','('])
fpe=file_path_name_ext(r)
print,fpe.path
END


best regards

Reimar

>
> PRO Tester
> Help, Calls=callStack
> thisRoutine = (Str_Sep(StrCompress(callStack[0])," "))[0]
> callingRoutine = (Str_Sep(StrCompress(callStack[1])," "))[0]
> 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
>
> Remember (those of you who faithfully update your
> IDL version), this requires the obsolete STR_SEP
> function. :-)
>
> Cheers,
>
> David

--
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
http://www.fz-juelich.de/icg/icg-i/
============================================================ ======
a IDL library at ForschungsZentrum Juelich
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_lib_intro. html
[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 15:07:13 PDT 2025

Total time taken to generate the page: 1.51972 seconds