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

Home » Public Forums » archive » Re: Passing zero as a Parameter/ NOT KEYWORD_SET
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: Passing zero as a Parameter/ NOT KEYWORD_SET [message #16067 is a reply to message #16066] Tue, 29 June 1999 00:00 Go to previous messageGo to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Martin Schultz (mgs@io.harvard.edu) writes:

>> The best way to proceed is pretend keyword_set() was really
>> named is_defined_and_non_zero(). Forget that it's called
>> keyword_set().

> In fact it is "is_defined_and_uneven" !
> Just try to pass var=2 into a routine and print keyword_set(var). Hope,
> David will take notice of this in his article.

Most people use Keyword_Set for entirely the wrong thing.
Keyword_Set very clearly returns 0 if the argument is 0 or
undefined. It returns a 1 if the argument is *anything*
other than 0 or undefined. It should be used ONLY with
those keywords that require a Boolean value.

But I welcome your comments on the article. (Just don't
bug me night and day until I incorporate your comments. :-)

http://www.dfanning.com/tips/keyword_check.html

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
[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
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Zero vector detection in IDL
Next Topic: Re: Extra space around widget windows....

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

Current Time: Thu Oct 09 23:43:28 PDT 2025

Total time taken to generate the page: 0.64064 seconds