Re: dereferencing a pointer to an object array [message #32787] |
Fri, 08 November 2002 15:38  |
Pavel A. Romashkin
Messages: 531 Registered: November 2000
|
Senior Member |
|
|
I think David is right. Try stepping into the loop in your debugger, and
make sure your Obj_New returns valid objects and populates the array.
One thing that draws my attention here:
> self.ZoneGroupObjs = ptr_new(ZoneGroupObjs)
You only do this once per session, right?
Cheers,
Pavel
Brent Griffith wrote:
>
> greetings,
>
> What is the trick to dereferencing a pointer to an Object array? I
> want to keep track of an array of object references in another object.
> I don't know how many until runtime so I use a pointer to the object
> array and store that in the managing object. But when I go to access
> the thing, by dereferencing the pointer, the object array has the
> right size but all the objects are null.
>
> here is how I create and store the object array
>
> ZoneGroupObjs = objArr(self.numGroups)
> For i = 0, self.numGroups-1 do begin
> ZoneGroupObjs[i] = obj_new('ZoneGroup')
> endfor
> self.ZoneGroupObjs = ptr_new(ZoneGroupObjs)
>
> Then to access the objarr inside another method..
>
> theseGroupObjs=*self.ZoneGroupObjs
>
> But it doesn't work! Why?
>
> Thanks!
>
> Brent
|
|
|