
'ABSTRACT TYPE

macro ContainerClass(name,body)
  type name##Type body
  class name
  '
  string buffer
  '
  method constructor(sys n=1)
    buffer=nuls n*sizeof name##Type
  end method
  '
  method destructor()
    buffer=""
  end method
  '
  method GetMembers(sys i,n) as name##Type*
    sys le=len buffer
    sys en=(n+i)*sizeof name##type
    if le<en
      buffer+=nuls en-le 'auto expand
    end if
    return i+strptr buffer
  end method

  '
end macro


'CREATE CLASS

ContainerClass Vector3dArray, {double x,y,z}
'...
end class


#recordof Vector3darray
'#recordof Vector3darrayType


'CREATE OBJECT

new Vector3dArray v(100)
'#show let pv=Vector3dArrayType(50,3)

Vector3dArrayType *pv

'OBTAIN POINTER AND FILL CHUNK


#show @pv=v.GetMembers(50,3) 'offset, quantity
pv<=1,2,3, 10,20,30, 100,200,300
'...

'TEST

print pv[3].y

del v




