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

Home » Public Forums » archive » Re: Probs w/ 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: Probs w/ keyword_set [message #2510 is a reply to message #2509] Wed, 03 August 1994 02:03 Go to previous message
sjt is currently offline  sjt
Messages: 72
Registered: November 1993
Member
Alan Tai (tai@rockola.larc.nasa.gov) wrote:
: This is probably old news, but in IDL 3.6 (and I think in 3.51), I
: realized early on that you run into problems by setting a keyword
: parameter to 0 and running it through keyword_set. I.e. keyword_set
: believes the parameter is unset:

: pro test, Key = Key
: if (keyword_set(Key)) then print, 'Set' $
: else print, 'Unset'
: end
: test, Key = 0

: Solution: use n_elements instead of keyword_set. I found this out
: from reading through some procedures from the JHUAPL library.

This has always been the case. The main prupose of keyword_set as I've
always seen it is coupled with /<key> constructs.


: Alan

--
James Tappin, School of Physics & Space Research
University of Birmingham
sjt@xun8.sr.bham.ac.uk
"If all else fails--read the instructions!"


P.S. Did you know that keyword_set's argument needn't be a keyword! it
actually just returns 0 if arg is 0, '' or undefined and 1 otherwise.
[Message index]
 
Read Message
Read Message
Previous Topic: Reading binary data from cdrom using new PV-wave(v4.2)
Next Topic: extract_slice routine in IDL userlib....

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

Current Time: Sat Oct 18 15:46:56 PDT 2025

Total time taken to generate the page: 1.68231 seconds