comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » undefined keyword variables
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: undefined keyword variables [message #17617 is a reply to message #17531] Mon, 01 November 1999 00:00 Go to previous messageGo to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
davidf@dfanning.com (David Fanning) writes:
>
> Mark Fardal (fardal@weka.astro.umass.edu) writes:
>
>> A question: should you always be able to pass undefined variables as
>> keywords to IDL routines?
>
> Oh, this is absolutely normal behavior. (At least under the
> usual standards by which such things are judged in IDL.)
> Is it *correct* behavior? Don't know. But I would doubt it.
> Seems to me *any* optional input keyword should be capable of
> accepting an undefined variable as an argument. I would run
> it by RSI for confirmation.
>
>> In general I don't know why you should be able to safely feed
>> undefined variables to routines and expect them to work.
>
> Well, because you expect decent programmers to test any
> variable they expect to receive and define default values
> if one is not passed in. (As well as testing for data type
> and structure, but who among us does this except under
> exceptional conditions?)

I am never sure any more how undefined keywords are passed. It seems
to make a difference whether it's a built-in routine, or an IDL
routine. It seems to make a difference whether it's IDL 4 or 5. It
seems to make a difference if you refer to the variable by name before
calling the procedure (not necessarily setting its value). All these
factors make it hard to handle pass-through keywords consistently. It
would be nice (no, crucial!) to have this more carefully documented by
RSI.

As to David's suggestion to define default values, that's not always
feasible. What about the POSITION keyword? If it's not defined then
you want to rely on IDL's standard positioning. No default should be
required!

Craig


--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Can this be vectorized?
Next Topic: change widget slider maximum dynamically?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 09:28:25 PDT 2025

Total time taken to generate the page: 1.43987 seconds