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

Home » Public Forums » archive » Re: Discover the name (at calling level) of passed parameter
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: Discover the name (at calling level) of passed parameter [message #34004 is a reply to message #34001] Tue, 11 February 2003 06:15 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Kristian =?iso-8859-1?Q?Kj=E6r?= (Kristian.Kjaer@Risoe.DK) writes:

> I sometimes find myself wanting to know the name of a passed parameter:
> At the called procedure level I need to know the name that the parameter
> had at the calling level.
>
> The code below illustrates what I can_not_ do by simple means.
> Are there any dirty tricks I could emply to this end?
>
> Thanks for any pointers, Kristian
>
> ; --------- begin IDL code:
> pro test_par_name, p =
>
> help,p
> print ,'The name of the passed parameter was ','?',' and its value is
> ',p
> end
>
> ; --------- begin IDL command history:
> IDL> q=3D5D
> IDL> test_par_name,q
> P DOUBLE =3D 5.0000000
> The name of the passed parameter was ? and its value is 5.0000000
>
> ; --------- begin wish list:
> ; I'd like somehow to be able to get:
> Q DOUBLE =3D 5.0000000
> The name of the passed parameter was Q and its value is 5.0000000

Alright, here it is. But you didn't hear it from me. :-(

pro test_par_name, p
help,p
name = Routine_Names(p, Arg_Name=(-1))
print ,'Name of passed parameter was ',name,' and its value is',p
end

You can find more information here:

http://www.dfanning.com/tips/access_main_vars.html

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
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: find contoure
Next Topic: Change to exclusive buttons in 5.6?

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

Current Time: Fri Oct 10 03:47:39 PDT 2025

Total time taken to generate the page: 0.98945 seconds