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

Home » Public Forums » archive » Setting a variable to the name of the folder it is in two steps up..
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Setting a variable to the name of the folder it is in two steps up.. [message #92583] Mon, 18 January 2016 19:21 Go to next message
Jake Haslemann is currently offline  Jake Haslemann
Messages: 1
Registered: January 2016
Junior Member
Hi everyone! First Post here, so we will see how it goes.. This may or may not be a very simple question to answer, but I was wondering if anyone knew a way to set a variable to the name of the folder it is in, but two steps up in the directories.. For example, if my path reads:
jake/L100/hbetacodetemp/p45
and my idl code is located in p45...
I want to set a variable to the value "L100" or whatever that folder will be.

In other words I want to set the variable:
identifier = L100
but without typing that out explicitly, such that the code will be able to gather that for me
Re: Setting a variable to the name of the folder it is in two steps up.. [message #92584 is a reply to message #92583] Mon, 18 January 2016 21:21 Go to previous message
Jim  Pendleton is currently offline  Jim Pendleton
Messages: 165
Registered: November 2011
Senior Member
On Monday, January 18, 2016 at 8:21:15 PM UTC-7, Jake Haslemann wrote:
> Hi everyone! First Post here, so we will see how it goes.. This may or may not be a very simple question to answer, but I was wondering if anyone knew a way to set a variable to the name of the folder it is in, but two steps up in the directories.. For example, if my path reads:
> jake/L100/hbetacodetemp/p45
> and my idl code is located in p45...
> I want to set a variable to the value "L100" or whatever that folder will be.
>
> In other words I want to set the variable:
> identifier = L100
> but without typing that out explicitly, such that the code will be able to gather that for me

Take a look at the docs for the functions ROUTINE_FILEPATH and STRSPLIT, for example, http://www.exelisvis.com/docs/routine_filepath.html.

Jim P.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: i cann't open idl because idlde.exe has stopped working.
Next Topic: "error initializing graphics device window" in the new Python bridge

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

Current Time: Wed Oct 08 09:19:28 PDT 2025

Total time taken to generate the page: 0.00390 seconds