Re: Save IDL Procedure Name [message #31950 is a reply to message #31949] |
Thu, 29 August 2002 08:11  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
wen (wku@qeallc.com) writes:
> Does anyone know if there is a way to save an IDL procedure name as a
> variable? I would like to be able to use this name within my
> procedure.
Humm, this may be a trick question. Let me try to
answer the question I think you are trying to ask.
Are you trying to do something like this:
**************************************************
PRO DrawIt, procedure, data,_Extra=extra
On_Error, 1
IF N_PARAMS() NE 2 THEN Message, 'Need two parameters.'
IF Size(procedure, /TName) NE 'STRING' THEN $
Message, 'First parameter must be a string.'
ok = Execute(procedure+ ', data, _Extra=extra')
IF NOT ok THEN Message, 'Procedure execution failed.'
END
*****************************************************
Then,
IDL> DrawIt, 'Surface', dist(30)
IDL> DrawIt, 'Contour', dist(30), NLevels=12, /Follow
IDL> DrawIt, 'Plot', Findgen(11)
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
|
|
|