Re: passing string parameter [message #7216 is a reply to message #7211] |
Thu, 17 October 1996 00:00  |
Tim Patterson
Messages: 65 Registered: October 1995
|
Member |
|
|
daytime visitor ssg login wrote:
>
> Hello, I want to write a small help procedure to display breif summaries
> of home made commands.
>
> IDL> helpme, command_name_string
>
> Is there a way to pass command_name_string to the procedure helpme
> without quotes?
>
> George McCabe, george@replica.gsfc.nasa.gov
if the command is for example, sortnames, I don't think
it's possible to pass it into a procedure as
IDL> helpme, sortnames
(as you'vbe obviously discovered! :)
You have to use
IDL> helpme, 'sortnames'
Or do it in two stages
IDL> sortnames='sortnames'
IDL> helpme, sortnames
You could use this second method by having a file that
initialises the helpme tool. This file could define
string variables containing the command names e.g.
;; list of commands
sortnames = 'sortnames'
printnames = 'printnames'
anothercommand = 'anothercommand'
and so on
Then when you start IDL, the user enters
IDL > @helpme_init
to define all the variables and thereafter he
can just use the helpme system as
IDL> helpme, printnames
and so on. Not elegant, but it should work ok.
Maybe somebody will come up with a better idea! Be interesting
to see
Tim
--
http://condor.lpl.arizona.edu/~tim/
|
|
|