[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Structure field concatenation

(at the risk of being the only one here who still hasn't
figured this out)

David Fanning wrote:
> Amara Graps (Amara.Graps@mpi-hd.removethis.mpg.de) writes:

> The problem here, Amara, is not that the second pointer is
> overwriting the definition of the first pointer. It is that
> the second pointer *IS* the first pointer! And you have
> re-defined what it points to.

I appreciate your answer, but then I am back to the same error
I inquired about a couple of weeks ago, i.e.:

If I do this:
thisstruc = {orbit:'',freq:ptr_new()}
instead of this:
thisstruc = {orbit:'',freq:ptr_new(/allocate_heap)}

I get this error when I start to create an array of structures 
and fill it:

periodcube = replicate(thisstruc,1)
periodcube(0).orbit = 'G2'
*periodcube(0).freq=DINDGEN(100)  ;first pointer array is len 100

% Unable to dereference NULL pointer: <POINTER  (<NullPointer>)>.

So since my pointer problem from yesterday was that I was pointing
to the same heap, I tried creating separate structures 
to concatenate:

thisstruc1 = {orbit:'',freq:ptr_new(/allocate_heap)}
thisstruc2 = {orbit:'',freq:ptr_new(/allocate_heap)}

And then I can't concatenate:
% Conflicting data structures: TEMPPERIOD,concatenation.

I seem to be living in an oscillating universe. :-(



Amara Graps               | Max-Planck-Institut fuer Kernphysik
Interplanetary Dust Group | Saupfercheckweg 1   
+49-6221-516-543          | 69117 Heidelberg, GERMANY
                          * http://galileo.mpi-hd.mpg.de/~graps  
      "Never fight an inanimate object." - P. J. O'Rourke