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 #50224 is a reply to message #50223] Mon, 18 September 2006 05:13 Go to previous message
Maarten[1] is currently offline  Maarten[1]
Messages: 176
Registered: November 2005
Senior Member
Edd wrote:
> 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?

Perhaps my reading comprehension isn't quite awake yet, but:

1) do you mean the names themselves, or the number of fields (there may
also be a fuu around, in addition to the foo, bar and baz)?

Get the names with tag_names(data), obtain the length with
size(data.(0), /dim), create a base struct with base =
CREATE_STRUCT(...) and replicate() the base to the right size. At least
that is where I would look. Copying is another matter, perhaps others
can comment on how to do this efficiently. At least you have the right
structure to store the stuff.

Maarten
[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: Sun Oct 12 00:24:58 PDT 2025

Total time taken to generate the page: 0.87833 seconds