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 #33969] Wed, 12 February 2003 04:22 Go to previous message
Kristian Kjaer is currently offline  Kristian Kjaer
Messages: 58
Registered: June 1998
Member
Now what if I have a function instead of a procedure:
I don't suppose there is any hope with

IDL> p2=myfunction(p)

to discover, at myfunction's level, the name at the calling level
('p2'), of the variable where the function's returned value will end up?

I guess I need to convert the syntax to

IDL> p2=p & myprocedure,p ; or
IDL> myprocedure,p2,p

Or need I?

- Kristian

David Fanning wrote:
> 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

> 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
[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: Thu Oct 09 22:02:49 PDT 2025

Total time taken to generate the page: 0.48000 seconds