Discover the name (at calling level) of passed parameter [message #34005] |
Tue, 11 February 2003 05:07 |
Kristian Kjaer
Messages: 58 Registered: June 1998
|
Member |
|
|
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=5D
IDL> test_par_name,q
P DOUBLE = 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 = 5.0000000
The name of the passed parameter was Q and its value is 5.0000000
-------------------------
Kristian Kjær, Risø National Laboratory, Denmark
|
|
|