Re: Getting running routine name [message #33530] |
Thu, 09 January 2003 14:41 |
sheryn.gillin
Messages: 6 Registered: January 2003
|
Junior Member |
|
|
> I need to know if it is possible with IDL to get, from inside a given
> function or procedure, a string with the name of the function or
> procedure itself.
Have you tried HELP, /FUNCTIONS or HELP, /PROCEDURES or more
generically HELP, /ROUTINES?
I don't know of any other way, and if you have multiple routines
running you mightn't be able to distinguish, but hope it helps.
Cheers
|
|
|
Re: Getting running routine name [message #33536 is a reply to message #33530] |
Thu, 09 January 2003 11:15  |
Stein Vidar Hagfors H[2]
Messages: 28 Registered: October 2002
|
Junior Member |
|
|
David Fanning <david@dfanning.com> writes:
> Harro Uwe Hieninger (hiening@zi.biologie.uni-muenchen.de) writes:
>
>> try
>> help, CALLS=calls
>>
>> then calls is an array
>> containing some info ;-)
>
> Uh, right. Sort of like this:
>
> PRO EXAMPLE
> Help, Calls=callStack
> thisRoutine = (StrSplit(StrCompress(callStack[0])," ", /Extract))[0]
> Print, 'I am ' + thisRoutine
> END
>
> IDL> example
> I am EXAMPLE
David, how are people ever going to learn to stand on their own feet when
you keep handing them all the solutions on a silver platter :-) Speaking of
canned stuff (on a silver platter?), look at
ftp://sohoftp.nascom.nasa.gov/solarsoft/gen/idl/system/get_c alldetails.pro
--
------------------------------------------------------------ --------------
Stein Vidar Hagfors Haugan
ESA SOHO SOC/European Space Agency Science Operations Coordinator for SOHO
NASA Goddard Space Flight Center, Tel.: 1-301-286-9028
Mail Code 682.3, Bld. 26, Room G-1, Cell: 1-240-354-6066
Greenbelt, Maryland 20771, USA. Fax: 1-301-286-0264
------------------------------------------------------------ --------------
|
|
|
Re: Getting running routine name [message #33540 is a reply to message #33536] |
Thu, 09 January 2003 09:46  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Pavel A. Romashkin (pavel_romashkin@hotmail.com) writes:
> I suppose that's exactly the difference between David and a typical
> participant of this newsgroup ;-) - taking the extra 5 minutes to help out.
Well, remember, I'm gathering material to teach in IDL
courses. Everyone else is just taking five illicit minutes
away from work. :-)
Cheers,
David
--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|
Re: Getting running routine name [message #33542 is a reply to message #33540] |
Thu, 09 January 2003 09:28  |
Pavel A. Romashkin
Messages: 531 Registered: November 2000
|
Senior Member |
|
|
Harro Uwe Hieninger wrote:
>
> I left the solution to the reader, so that he could consult the online
> help and understand what he is doing
I suppose that's exactly the difference between David and a typical
participant of this newsgroup ;-) - taking the extra 5 minutes to help out.
Cheers,
Pavel
|
|
|
Re: Getting running routine name [message #33543 is a reply to message #33542] |
Thu, 09 January 2003 09:15  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Harro Uwe Hieninger (hiening@zi.biologie.uni-muenchen.de) writes:
> right you are !
>
> I left the solution to the reader, so that he could consult the online
> help and understand what he is doing
>
> ;-))
Oh, of course. I use that pedagogical trick myself from
time to time. :-)
> BTW, the strCompress call is not really necessary for THIS purpose, is it?
Probably not. I stole this from some working code. I'm
sure there is a reason for it somewhere. :-)
Cheers,
David
--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|
Re: Getting running routine name [message #33544 is a reply to message #33543] |
Thu, 09 January 2003 08:51  |
hieninger
Messages: 9 Registered: December 2002
|
Junior Member |
|
|
Hi David,
right you are !
I left the solution to the reader, so that he could consult the online
help and understand what he is doing
;-))
BTW, the strCompress call is not really necessary for THIS purpose, is it?
Harro
|
|
|
Re: Getting running routine name [message #33545 is a reply to message #33544] |
Thu, 09 January 2003 08:23  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Harro Uwe Hieninger (hiening@zi.biologie.uni-muenchen.de) writes:
> try
> help, CALLS=calls
>
> then calls is an array
> containing some info ;-)
Uh, right. Sort of like this:
PRO EXAMPLE
Help, Calls=callStack
thisRoutine = (StrSplit(StrCompress(callStack[0])," ", /Extract))[0]
Print, 'I am ' + thisRoutine
END
IDL> example
I am EXAMPLE
Cheers,
David
--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|
|