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

Home » Public Forums » archive » Re: Maddening 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: Maddening structures [message #50221 is a reply to message #50220] Mon, 18 September 2006 06:52 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Edd writes:

> OK, I've got some data read in so that I have a structure that looks
> like
>
> data.foo[600]
> .bar[600]
> .baz[600]
>
> and I want
> data[600].foo
> .bar
> .baz
>
> In other words I want an array of structures rather than a structure
> of arrays.
>
> Does anyone have any magic that works for the case when foo, bar and
> baz are not previously known?

names = ['foo','bar', 'baz']
struct = Create_Struct(names[0], 0.0, names[1], 0.0, names[2], 0.0)
data = Replicate(struct, 600)

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: calculating rotations from a transformation matrix
Next Topic: IMSL coming to IDL

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

Current Time: Fri Oct 10 04:52:24 PDT 2025

Total time taken to generate the page: 2.00509 seconds