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

Home » Public Forums » archive » Re: Clever Where() test
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: Clever Where() test [message #4441 is a reply to message #4386] Tue, 30 May 1995 00:00 Go to previous message
thompson is currently offline  thompson
Messages: 584
Registered: August 1991
Senior Member
steinhh@amon.uio.no (Stein Vidar Hagfors Haugan) writes:


> In article <3q2tld$8du@post.gsfc.nasa.gov>, thompson@orpheus.nascom.nasa.gov (William Thompson) writes:
> |> 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
> |>

> Just nit-picking: If the tag i in x.i is an array, only
> the (x.i)(0) notation works. This works if x and/or i are
> arrays (or scalars).


> Stein Vidar

Hi, Stein Vidar!

Even more nitty nit-picking: The post did say "a scalar element of a
structure". However, you're correct--Paul's way would work in either case.

Bill Thompson
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: V4.0 Exclusive Button Groups
Next Topic: Different FFT-results on vector and array?!

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

Current Time: Sat Oct 11 12:11:44 PDT 2025

Total time taken to generate the page: 0.39710 seconds