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

Home » Public Forums » archive » 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 #4219 is a reply to message #4216] Fri, 12 May 1995 00:00 Go to previous messageGo to previous message
zawodny is currently offline  zawodny
Messages: 121
Registered: August 1992
Senior Member
In article <3p03k3$ip1@kwuz.nerc-keyworth.ac.uk> wmc@unixa.nerc-keyworth.ac.uk writes:
>
> Another solution is to set key=[0], ie the array containing 0.
> Then keyword_set returns true, and IDL happily uses [0] and 0 fairly
> interchangably.
>

Yes, but in practice this might appear in code as follows:

pro MYPRO, v1, v2, key1=key1, key2=key2
...
if KEYWORD_SET([key1]) then ...
...
return
end

The problem here being that when IDL tries to put key1 into a single
element vector and key1 has not been passed in the call, IDL will barf
with "variable key1 undefined".

I think you were suggesting that the user type instead

IDL> mypro,v1,v2,key1=[0]

If so I think you are asking too much of the user and would be better
off just changing the code to use N_ELEMENTS() instead of KEYWORD_SET().

--
Joseph M. Zawodny (KO4LW) NASA Langley Research Center
Internet: j.m.zawodny@larc.nasa.gov MS-475, Hampton VA, 23681-0001
TCP/IP: ko4lw@ko4lw.ampr.org Packet: ko4lw@n4hog.va.usa.na
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Angstrom symbol
Next Topic: IDL spreadsheet??

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

Current Time: Sat Oct 11 15:50:47 PDT 2025

Total time taken to generate the page: 0.00984 seconds