[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Clever Where() test
- Subject: Re: Clever Where() test
- From: thompson(at)orpheus.nascom.nasa.gov (William Thompson)
- Date: 25 May 1995 21:43:09 GMT
- Newsgroups: comp.lang.idl-pvwave
- Organization: NASA Goddard Space Flight Center -- Greenbelt, Maryland USA
- References: <moleD93CEG.79n@netcom.com> <3pvv76$q4j@lace.Colorado.EDU> <3q24cm$1rui@news.doit.wisc.edu>
Paul Probert <probert@uwmfe.neep.wisc.edu> writes:
>IDL allows you to give a zero subscript to a scalar,
>so you can say:
> i=WHERE(...)
> IF i(0) EQ -1 THEN BEGIN
> ...
>
>One word of caution. If you have a scalar element of a structure,
>for some reason you can't do this:
> x={i:0,j:1}
> IF x.i(0) ... ;bombs
>But you can make it work with more parentheses:
> IF (x.i)(0) ... ;works
>
> Paul Probert
> University of Wisconsin
So does x(0).i
Bill Thompson