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

Home » Public Forums » archive » Re: structure arrays with different 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: structure arrays with different structures [message #81383 is a reply to message #81382] Sat, 08 September 2012 21:18 Go to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
On Saturday, September 8, 2012 9:08:39 PM UTC-4, Søren Frimann wrote:
> Hi all,
>
>
>
> I'm having some data that's gathered together in different structures and arrays, and I want to collect everything in a structure array in this manner:
>
>
>
> struct_template = { name:'', select:{} , obs:dblarr(2,100)}
>
>
>
> I want to put my data into struct_template, with name being a string, select being another structure, and obs being an array.
>
>
>
> I then want to make an array of structures using struct_template, but naturally with different sets of data.
>
>
>
> The issue is that the select structure does not always have the same skeleton, nor does the obs array always have the same size.
>
>
>
> The question basically is if there's any way of making an array of structures with the structures sharing the same keys, but with the values having different 'skeletons'

You want to use pointers. It's what pointers were invented for.

However, don't go overboard with pointers. It can create a managerial nightmare. I would advise you to keep the basic structure the same, so you can have an array of identical structures. Use pointers for your OBS field and other variations from entry to entry.

Craig
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Can't launch IDL DE anymore...
Next Topic: Re: Off-kilter z-axis label in function graphics?

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

Current Time: Fri Oct 10 10:48:49 PDT 2025

Total time taken to generate the page: 0.42064 seconds