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

Home » Public Forums » archive » Re: Array of structures.
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Array of structures. [message #19982] Tue, 16 May 2000 00:00
Ben Tupper is currently offline  Ben Tupper
Messages: 186
Registered: August 1999
Senior Member
Nicolas Decoster wrote:

> Hi.
>
> I'd like to build an array of structure using one line. Something like
> that:
>
> arr = [{sig:a, color:'red'}, {sig:b, color:'green'}]
>
> I don't want to use the replicate function and then fill the array one
> by one:
>
> arr = replicate({myStruct, sig:a, color:'red'}, 2)
> arr[0] = {myStruct, sig:a, color:'red'}
> arr[1] = {myStruct, sig:b, color:'green'}
>
> Any suggestions ?
>
> Thanks.
>
> Nicolas.
>
> ps: In fact, I'm trying to find a way to handle lists of anything. In
> the present case I want to pass as one argument a list of signals
> (arrays of value) associated with a color. The list must be of any size,
> we must be able to build it on the fly. Something like that : {{sig1
> 'red'} {sig2 'green'}} in a Tcl-like syntax.
>
>

Hello,

I think you should look into employing a pointer array. Each element of
the pointer array can point to anything (like structures, etc.)

Look into PTRARR() function.

Ben


--
Ben Tupper

Bigelow Laboratory for Ocean Science
tupper@seadas.bigelow.org

pemaquidriver@tidewater.net
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: newbie:Volume Rendering on IDL
Next Topic: Re: Contour plots on maps

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

Current Time: Wed Oct 08 15:11:07 PDT 2025

Total time taken to generate the page: 0.00487 seconds