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

Home » Public Forums » archive » Re: SOLVED Re: puzzled with 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: SOLVED Re: puzzled with WHERE [message #21639] Thu, 07 September 2000 05:43
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Henk (deckard_007@deja.com) writes:

> Sorry, stupid. one-dimensional array is not the same as a simple float
> value.
> Can't IDL solve this ?

Probably, but I think the request falls into the
"having your cake and eating it too" category. Clearly
someone made the decision (I'd bet at a user request)
to have the WHERE function do different things based
on whether the array in question is being compared
to a scalar or to an array. (This is well documented
in the on-line help.)

Changing the rule arbitrarily for a little array
would surely bring down the ire of all those people
who have come to depend on this behavior. If it were
me, I'd put this request into the "forget it" pile. :-)

Cheers,

David

P.S. Since there is real danger of carpel tunnel
syndrome for those of us foolish enough to sit
in front of a computer all day instead of getting
a real job, allow me to point out, Henk, that
you are doing a LOT of unnecessary typing:

xlist = fltarr(1000)
xlist = findgen(1000)

The first statement may have been required in
FORTRAN or PASCAL back when you and I were
in school (it is so long ago I can barely
remember), but it is totally unnecessary (one
might say pointless) to declare variables in
IDL like this, since IDL types variables on
the fly. In other words, this is perfectly
acceptable in IDL:

xlist = fltarr(1000)
xlist = 5

Since IDL is going to ignore the first statement
anyway, why type it? You can get along just
creating your variables the way you like without
declaring them:

xlist = findgen(1000)

--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
[Message index]
 
Read Message
Previous Topic: Horrible map reprojections
Next Topic: Re: Horrible map reprojections

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

Current Time: Fri Oct 10 10:07:25 PDT 2025

Total time taken to generate the page: 1.51955 seconds