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 #16082 is a reply to message #16081] 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
J.D. Smith (jdsmith@astrosun.tn.cornell.edu) writes:

> That's a bit dangerous. IDL may have strange semantics and constructs,
> but that's no reason not to learn them. I recommend peeking at a bit of
> IDL source code available all over the web. You'll find common
> constructs such as:
>
> ; give foo a default value if it is undefined.
> if n_elements(foo) eq 0 then foo=5
> ; perform some action if flag is defined and non-zero
> if keyword_set(flag) then compute_something
> ; return something to the caller if var is available to them (by
> reference)
> if arg_present(var) then var=compute_something_else()

Ah, finally, some sense on this topic! Thanks, JD.

I lost my news feed yesterday and the article I posted on this
topic got eaten by DejaNews (probably fortunately). But nothing
causes more confusion for users than these three totally misnamed
functions: N_Elements, Keyword_Set, and Arg_Present.

I'm in the process of writing an article on the subject for my
web page right this minute. (Why I haven't done it before is
a mystery. It's the single most misunderstood programming
feature I see in my travels.) It will be on my site sometime
this afternoon (Colorado time).

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: Wed Oct 08 19:27:03 PDT 2025

Total time taken to generate the page: 0.08570 seconds