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

Home » Public Forums » archive » Re: Keyword discrimination
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: Keyword discrimination [message #12522 is a reply to message #12518] Wed, 12 August 1998 00:00 Go to previous message
Vap User is currently offline  Vap User
Messages: 31
Registered: April 1998
Member
Imanol Echave <ccaeccai@sc.ehu.es> writes:

I take it that you are trying to determine whether a keyword is set in
order to know whether to calculate an output variable.

There is no way to discriminate these two cases for versions < 5.1
that I am aware of. However, in IDL 5.1 there is the function
ARG_PRESENT() which will tell you that a keyword or positional
argument is present and is a named variable into which a value may be
passed.

If you are working with a version < 5.1 and the data intended for
output is small, there isn't much penalty in creating it whether the
return variable is there or not. Otherwise, you might need a two
variable scheme, one, a flag to tell the routine to calculate the
output, and the other the actual output area.

Best bet, get IDL 5.1 and use arg_present.


FYI: keyword_set(arg) = 0 if arg is undefined, or arg is not present
in call, or arg=0,

> Hi people:
>
> he question is: How to discriminate between a keyword not set and a
> keyword set to an undefined variable? N_ELEMENTS returns 0 in the
> two cases.


--
I don't speak for JPL, it doesn't speak for me.
Well, not all the time, at least.
William Daffer <vapuser@haifung.jpl.nasa.gov>
[Message index]
 
Read Message
Read Message
Previous Topic: Getting filename from PS device
Next Topic: problems with ENVI orthorectification

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

Current Time: Sat Oct 11 20:50:57 PDT 2025

Total time taken to generate the page: 0.72529 seconds