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

Home » Public Forums » archive » nested 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
nested structures [message #84459] Mon, 27 May 2013 05:04
hannah_ue is currently offline  hannah_ue
Messages: 14
Registered: November 2012
Junior Member
Hi there,

I have some questions about nested structures, i.e. if what I want is possible. I should say that I'm not familiar with pointers.

What I would need is an array of structures (which I know how to build) with one of the tags being another array of structures which should have different lengths, not known in the beginning.
I assume that I need pointers for this, but I do not understand how to assign certain values in this nested structure.
I also do not understand, how (or if?!) I can extend the nested structure.

So far, I have something like this:

struct1 = {A, tag_a1:0L, tag_a2:ptr_new(/allocate_heap)}
struct2 = {B, tag_b1:0.0, tag_b2: 0.0}
*struct1.tag_a2 = struct2

strlist = replicate({struct1}, 10)
strlist.tag_a2 = ptrarr(n_elements(struct1), /allocate)

Is this meaningful?
How can I replicate struct2 for one of the struct1's?
How can I assign a value in here, say tag_b2 = 1.5?
Should I better work with lists?

Thanks a lot for your help and clarifying!
Hannah
[Message index]
 
Read Message
Previous Topic: on the background color of cgplot
Next Topic: Re: on the background color of cgplot

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

Current Time: Wed Oct 08 16:07:28 PDT 2025

Total time taken to generate the page: 0.00439 seconds