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

Home » Public Forums » archive » Re: referencing structure arrays
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: referencing structure arrays [message #68008 is a reply to message #68007] Thu, 10 September 2009 09:12 Go to previous message
nivedita.raghunath is currently offline  nivedita.raghunath
Messages: 15
Registered: July 2006
Junior Member
Sorry, looks like what I typed looks gibberish in places. I hope this
one is more readable:


Hi All,

I have a problem referencing structure arrays and assigning values to
them. So here is a snippet of my code:

junk1=update_state(junk) ;creates a structure called junk1
statearr=replicate(junk1,3) ;creates an array of structures

infoptr=ptr_new({statearr:statearr}) ;need this to pass variables
between programs

align_images,state=state1 ;some program that aligns 2 images and
stores the alignment results in state1

;assign values from the state1 structure to infoptr.statearr[0]
structure
(*infoptr).statearr[0].resvol_file_ptr=state1.resvol_file_pt r
(*infoptr).statearr[0].air_file_ptr=state1.air_file_ptr

Now, here is the problem. With the above code, it turns out that...

(*infoptr).statearr[0].resvol_file_ptr, (*infoptr).statearr
[1].resvol_file_ptr, (*infoptr).statearr[2].resvol_file_ptr
all have the same values. Similarly with air_file_ptr. Even though I
haven't assigned anything to the statearr 1 and 2 yet.

Is there a specific way to reference these structure arrays? Any help
is greatly appreciated!

Thanks
Niv
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Readu, Writeu Causing Segmentation Fault
Next Topic: Issue with logrithmic z-axis... fix?

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

Current Time: Wed Oct 08 19:34:21 PDT 2025

Total time taken to generate the page: 0.00392 seconds