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

Home » Public Forums » archive » Re: keyword_set bug or feature
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_set bug or feature [message #4205] Mon, 15 May 1995 00:00 Go to previous message
chase is currently offline  chase
Messages: 62
Registered: May 1993
Member
>>>> > "Rob" == Stephen O'Connell <soc@festival.ed.ac.uk> writes:

Rob> Keyword is more than just 1/0 switches! And if you are using them
Rob> to pass values, you just might mistakenly set one equal to zero.
Rob> Andd although its true that you can use n_elements, you're still
Rob> buggered if you have more than one keyword...so it is a bug
Rob> really, in my opinion. Maybe ver. 4.0 has it sorted - does
Rob> anyone know ?

It is not a bug. KEYWORD_SET works exactly as documented in the "IDL
Reference Guide". Furthermore, the guide states: "This function is
especially useful in user-written procedures and functions that
process keywords that are interpreted as being either true (keyword
present and nonzero) or false (keyword was not used, or was set to
zero)." Thus, its purpose is not for checking if a keyword is used to
pass values. Just because KEYWORD_SET does not do what you wish does
not mean it has a bug. Use

N_ELEMENTS(var) NE 0

to check for defined keywords. You can make your own function
"KEYWORD_DEFINED()" if you think it is more convenient than
"N_ELEMENTS(var) NE 0".

Chris

--
===============================
Bldg 24-E188
The Applied Physics Laboratory
The Johns Hopkins University
Laurel, MD 20723-6099
(301)953-6000 x8529
chris.chase@jhuapl.edu
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: Plotting to file
Next Topic: Re: Bad pixmap error, pixmap allocation, keywords

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

Current Time: Sat Oct 11 03:42:49 PDT 2025

Total time taken to generate the page: 1.60555 seconds