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

Home » Public Forums » archive » CASE statement
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: CASE statement [message #27045 is a reply to message #26552] Sat, 06 October 2001 03:01 Go to previous messageGo to previous message
weitkamp is currently offline  weitkamp
Messages: 33
Registered: October 1998
Member
Paul van Delst <paul.vandelst@noaa.gov> wrote in messagenews:<3BBE2163.F73A162D@noaa.gov>...
> "Pavel A. Romashkin" wrote:
>>
>> Timm Weitkamp wrote:
>>>
>>> It actually also has some counterintuitive features. This one, for
>>> example:
>>>
>>> IDL> PRINT, KEYWORD_SET([0])
>>> 1
>>
>> Correct me if I am wrong, but the PURPOSE of KEYWORD_SET is to check if
>> a KEYWORD is SET. Settable keywords are those that you either set or
>> don't, either /K_SET or K_SET=0. As such, they should not be set to
>> arrays. As far as I can see, Keyword_Set is a convenience function. For
>> value passing keywords, N_elements should be used.
>> So, it looks to me that the name of this function means exactly what it
>> is designed for.
>
> Excellent point.
>
> paulv

Pavel and Paul,

I mostly agree with you. But when you're programming a routine, even
if you do use KEYWORD_SET in the strictly limited context that it
should be, it is still possible that the user of the routine
accidentally passes [0] (or [1]) instead of 0 (or 1) if the keyword is
passed as an expression and not as an explicit value as in Pavel's
example. Of course you may then blame the user, but that is of limited
help.

Timm
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: IDL LINUX support question
Next Topic: interpol

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

Current Time: Sun Oct 12 04:50:42 PDT 2025

Total time taken to generate the page: 1.76175 seconds