Re: ROUTINE_INFO problems [message #30201 is a reply to message #30199] |
Wed, 10 April 2002 18:19   |
Mark Hadfield
Messages: 783 Registered: May 1995
|
Senior Member |
|
|
"Ted Cary" <tedcary@yahoo.com> wrote in message
news:3CB4C6E7.657CD4A5@yahoo.com...
> Mark Hadfield wrote:
>
>> Try the ROUTINE_INFO function with keyword PARAMETERS set and
>> examine the KW_ARGS tag in the structure it returns. (I found this
>> in the docs & I haven't tried it myself.) Just out of curiosity,
>> why do you want to do this?
>
> Thanks for the tip. ROUTINE_INFO sounded like exactly what I want,
> but I played with it for a bit and it doesn't work as expected, at
> least not for system routines like PLOT. In fact, I can't imagine
> it does what anyone wants with system routines, since the PARAMETERS
> structure it returns is just wrong.
Well I *did* say I hadn't tried it myself.
> ...Here is the output for the 'PLOT' procedure.
>
> IDL> plotParams = ROUTINE_INFO('PLOT', /PARAMETERS)
> IDL> PRINT, plotParams.num_args
> 0
> IDL> PRINT, plotParams.num_kw_args
> 0
>
> That's not right. I tried ROUTINE_INFO on PTR_FREE and even on
> itself, but the results were the same. Probably this is all
> documented or I'm just messing up, but why does ROUTINE_INFO return
> the PARAMETERS structure for system routines if it's going to lie
> about it?
You don't really want an answer to that question, do you? Not from
anyone other than the author of the routine, anyway. Though David
could probably think up something pithy & relevant. To do with tennis,
probably...
I think the answer is "Just because".
> The parameter information it returns for non-system routines also
> could be more complete. If a routine uses keyword inheritance and
> passes along an _EXTRA structure to a subroutine, then the KW_ARGS
> field of the PARAMETERS structure returned by ROUTINE_INFO only
> contains the word '_EXTRA.' It would be more useful to know *all*
> the keywords that could be passed to the routine, including keywords
> of any subroutines called with _EXTRA .
I rather expected that one.
> I want this information because I'm toying around with an idea that
> will probably go nowhere. I'm trying to the use the keywords as
> Get/Set-able properties of an object class, if that makes any sense.
Not entirely, but it *would* be kind of cool to be able to query an
object to see what keywords its GetProperty and SeProperty methods
support.
> So is there any way to ascertain all the keywords accepted by any
> IDL routine, including keywords of system routines and including
> keywords inherited from subroutines?
Don't know, sorry (though I suspect not). JD is probably the expert on
this (as on many other things) because there is a routine-info
facility built into the IDLWAVE Emacs mode, which he currently
maintains. But it can't recurse into inheritance chains either.
--
Mark Hadfield
m.hadfield@niwa.co.nz Ka puwaha et tai nei
http://katipo.niwa.co.nz/~hadfield Hoea tatou
National Institute for Water and Atmospheric Research (NIWA)
My news host refused to accept this post the first time because of "more
included text than new". Aren't computers stupid. So here's some more new
text. So here's some more new text. So here's some more new text. So here's
some more new text. So here's some more new text. So here's some more new
text. So here's some more new text. So here's some more new text. So here's
some more new text. So here's some more new text. So here's some more new
text. So here's some more new text. So here's some more new text. So here's
some more new text. So here's some more new text. So here's some more new
text. So here's some more new text. So here's some more new text. So here's
some more new text. So here's some more new text. So here's some more new
text. So here's some more new text. So here's some more new text. So here's
some more new text. So here's some more new text. So here's some more new
text. So here's some more new text.
|
|
|