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

Home » Public Forums » archive » N_ELEMENTS and WHERE: Scalar or Array ?
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: N_ELEMENTS and WHERE: Scalar or Array ? [message #14215 is a reply to message #14130] Fri, 29 January 1999 00:00 Go to previous messageGo to previous message
Mark Buckley is currently offline  Mark Buckley
Messages: 7
Registered: December 1998
Junior Member
rmlongfield@my-dejanews.com wrote in message
<78s23o$525$1@nnrp1.dejanews.com>...

> I use WHERE to find some zeroes in a data set which I
> want to exclude in further processing. Problem
> is that sometimes they are all zeroes. Using a simple :
>
> non_zero_xvalues = WHERE (subarray1 GT 0)
> IF(non_zero_array EQ -1) ...
>
> gets me into trouble because, when it is an array, I get an error. If I use
> N_ELEMENTS(non_zero_array) there is always at least one element, whether it
> is -1 or something else. I don't like ignoring the 'something else' value
> just because it is the only one. Is the answer another IF statement or
some
> sort of error control?


I suspect that you need to use the COUNT parameter to WHERE, to tell
you how many values were matched in the WHERE clause. Check COUNT,
and if it is equal to zero, you know that none passed the test...

cheers,

Mark

Rutherford-Appleton Laboratory
Chilton
Didcot
OXON
[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
Previous Topic: Scalp editting??
Next Topic: Map spanning Dateline?

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

Current Time: Wed Oct 08 19:19:23 PDT 2025

Total time taken to generate the page: 0.00447 seconds