Re: N_ELEMENTS and WHERE: Scalar or Array ? [message #14224 is a reply to message #14130] |
Fri, 29 January 1999 00:00   |
David Kastrup
Messages: 33 Registered: February 1998
|
Member |
|
|
rmlongfield@my-dejanews.com writes:
> Hi All, I keep making the same mistake with N_ELEMENTS so I decided
> to write and ask if anyone has found a solution. 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.
How about
IF((size(non_zero_xvalues))[0] EQ 0)
Namely, checking whether non_zero_xvalues is a scalar?
Or, less complicated,
IF (non_zero_values[0] EQ -1)
because you are allowed to index a scalar with 0?
--
David Kastrup Phone: +49-234-700-5570
Email: dak@neuroinformatik.ruhr-uni-bochum.de Fax: +49-234-709-4209
Institut f�r Neuroinformatik, Universit�tsstr. 150, 44780 Bochum, Germany
|
|
|