The dynamic array is unique for each object and local to each method, so how is the array content preserved between method calls?
Using remap instead of redim
'REDIM DYNAMIC ARRAY INSIDE AN OBJECT
'
type cc
'
def remapaa
remap int aa(zz,yy,xx)
@aa=pa
end def
'
sys pa 'pointer to array content
int zz,yy,xx 'ubounds of array dimensions
'
procedure constructor(int z,y,x)
xx=x : yy=y : zz=z
pa=getmemory zz*yy*xx*sizeof(int)
remapaa
end procedure
'
function set(int v,z,y,x)
remapaa
aa(z,y,x)=v
end function
'
function get(int z,y,x) as int
remapaa
return aa(z,y,x)
end function
'
procedure destructor()
freememory pa
end procedure
'
end type
'
'test
'#recordof cc
new cc c(5,5,5)
c.set(42,4,3,2)
print c.get(4,3,2)
del c
WOW...nice Charles ;)