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

Home » Public Forums » archive » Non-intuitive result with !Null in Where()
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: Non-intuitive result with !Null in Where() [message #85616 is a reply to message #85610] Wed, 21 August 2013 16:51 Go to previous message
Heinz Stege is currently offline  Heinz Stege
Messages: 189
Registered: January 2003
Senior Member
On Wed, 21 Aug 2013 09:42:25 -0700 (PDT), Matthew Argall wrote:

> This is not what I expected. If there are no elements, how can "count" be non-zero? I was hoping that Where() would return !Null and "count" would be 0.
>
> IDL> print, n_elements(!Null)
> 0
> IDL> print, where(!Null ne 0, count)
> 0
> IDL> print, count
> 1
> IDL> print, where(!Null ne 0, count, /NULL)
> 0
> IDL> print, count
> 1
> IDL> print, !Null[0]
> % Expression must be an array in this context: !NULL.
> IDL> print, (!Null)[0]
> % Variable is undefined: <UNDEFINED>.
>
>
> The Where function is telling me I can access !Null at element 0, but I cannot.
>
This is not true. In your words, the Where function is telling you,
that the expression !null ne 0 has one element, which is not equal 0.
And the position of this element is 0.

IDL> expr=!null ne 0
IDL> help,expr[0]
<Expression> BYTE = 1

Heinz
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: stacking the images according to julian date
Next Topic: Re: spawn not working

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

Current Time: Wed Oct 08 19:27:11 PDT 2025

Total time taken to generate the page: 0.00480 seconds