[DGD] Multi-dimensional arrays
Erwin Harte
harte at xs4all.nl
Fri Mar 22 18:45:23 CET 2002
On Fri, Mar 22, 2002 at 07:33:00PM -0800, Sergey S. Koval wrote:
> Hello,
> I'we got nasty problem.
>
> I have following code:
>
> mixed * arr;
[...]
> arr = allocate(SIZE_Y);
> for (i = 0; i < SIZE_Y; i++) arr[i] = allocate(SIZE_X);
[...]
> arr[some_int_variable][some_int_variable] = ob;
>
> ... and have "Index on bad type" run-time error.
>
> When i'm trying to do following:
> arr[0][0] = 0;
> i have same error.
>
> What's wrong in my code ?
Nothing obvious (to me) from what you've quoted to us here.
I assume that all of this either happens inside one function, or that
'arr' is a global variable. If the latter, could it be that arr is
set back to nil in another part of the object, for instance by a
restore_object() call?
Cheers,
Erwin.
--
Erwin Harte <harte at xs4all.nl>
_________________________________________________________________
List config page: http://list.imaginary.com/mailman/listinfo/dgd
More information about the DGD
mailing list