[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: undefined keyword variables



In IDL5.2 several other plot keywords show the same behaviour as clip:

position, [xyz]margin, [xyz]range, [xyz]tickname, [xyz]tickv

I reported this to RSI a while back. In IDL5.3 (I'm running the Windows
beta version) this has been fixed. Presumably now the values from system
variables (!p.position, !x.margin, etc.) are used if the keyword
variable
is undefined.

Mark Fardal wrote:
> 
> Hi,
> 
> A question: should you always be able to pass undefined variables as
> keywords to IDL routines?
> 
> For example, PLOT is smart enough not to do anything with this undefined
> variable
> 
> IDL> plot,x,y,title=donkeykong
> [plots fine]
> 
> but not this one
> IDL> plot,x,y,clip=pong
> % PLOT: Variable is undefined: PONG.
> % Execution halted at:  $MAIN$
> [no plot produced]
> 
> IDL> help,donkeykong, pong
> DONKEYKONG      UNDEFINED = <Undefined>
> PONG            UNDEFINED = <Undefined>
> 
> Should this be considered a bug in plot, or as normal behavior?
> 
> In general I don't know why you should be able to safely feed
> undefined variables to routines and expect them to work.  But if you
> can't, it leads to annoying problems in writing interfaces to any
> routine with lots of keywords.  In my case, I wanted to write a
> routine that called plot and then oplot, which use different sets of
> optional keyword parameters.  The best solution I know of is to
> construct a value for the _extra keyword, but it's a pretty convoluted
> solution.
> 
> Mark Fardal
> UMass