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

Home » Public Forums » archive » Re: Expanding Arrays of Structures
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: Expanding Arrays of Structures [message #50349] Thu, 28 September 2006 08:50 Go to previous message
Foldy Lajos is currently offline  Foldy Lajos
Messages: 268
Registered: October 2001
Senior Member
On Thu, 28 Sep 2006, Haje Korth wrote:

> Hi,
> It's one of those days. You think you know IDL but you really don't.
> Well, may be someone can help.
>
> I have an array of structures created like
> s1={a:0,b:0,c:0}
> s2=replicate(s1,10)
>
> Is there a way to expand this array by another tag "d" so that
> essentially every array index contains the structure {a,b,c,d}?
>
> The reason why I don't include "d" right away is thatI read the
> structure content from files, where the additional variable is not
> available.
>
> I have looked at struct_assign and create_struct, but I don't think
> they can do what I want.
>
> Does anyone have any idea except copying every freakin' tag
> separately???
>
> Thanks,
> Haje
>

Hi,

struct_assign will do the job:

s1={a:1,b:2,c:3}
s2=replicate(s1,10)

s1ext={a:1,b:2,c:3,d:4} ; you can build s1ext with create_struct
s2ext=replicate(s1ext, 10)

struct_assign, s2, s2ext


regards,
lajos
[Message index]
 
Read Message
Read Message
Previous Topic: Re: subset an image by roi in idl
Next Topic: Structure Arrays

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

Current Time: Fri Oct 10 14:03:39 PDT 2025

Total time taken to generate the page: 0.64012 seconds