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

Home » Public Forums » archive » Re: keyword_set([0])
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([0]) [message #48059 is a reply to message #48058] Tue, 21 March 2006 11:24 Go to previous messageGo to previous message
JD Smith is currently offline  JD Smith
Messages: 850
Registered: December 1999
Senior Member
On Mon, 20 Mar 2006 15:49:14 -0800, vlk.astro wrote:

> JD Smith wrote:
>
>>
>> IDL> print, size(b,/N_DIMENSIONS) gt 0 OR keyword_set(b)
>
> Unfortunately, upon further investigation, this doesn't quite work.
> The behavior I am looking for is (sorry I wasn't clearer before): if
> A=0 and B=[0], then expr(A)=0 and expr(B)=1 in all versions of IDL (for
> backwards compatibility and all that)
>
> instead, 5.3 and 6.2 never match up properly --
>
> v5.3 v6.2 expr()
> 0 0 keyword_set(A)
> 1 0 keyword_set(B)
>
> 1 0 size(A,/dim) gt 0 OR keyword_set(A)
> 1 1 size(B,/dim) gt 0 OR keyword_set(B)
>
> i.e., if it works in 5.3, it doesn't in 6.2, and vice versa.

Not /DIM, /N_DIM (actually I'm not sure if that exists in 5.3, but in
that case (size(a))[0] should work). Your version with /DIM should work
for scalars and single element vectors anyway, so I'm not sure why it
doesn't here. In IDL5.5 (the oldest I have):

IDL> a=0
IDL> print,size(a,/dim) gt 0 OR keyword_set(a)
0

and of course the same in 6.2. I'm very surprised v5.3 is different --
in fact I can't imagine how it could be.

JD
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: RSINC web mini-bug ??
Next Topic: Need IDL Programmer

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

Current Time: Fri Oct 10 22:37:54 PDT 2025

Total time taken to generate the page: 0.23783 seconds