You might pass a pointer to the adress of the first array-element and also the Ubounds of each Dimension to the Sub/Function like
Type myType
foo as Integer
bar as Long
End Type
Dim my2DArray(12,34) as myType
SomeSub(Varptr(my2DArray(1,1)), 12, 34)
' ...
Sub SomeSub(Byval Pointer as Dword, byval XDims as Long, byval YDims as Long)
' inside the Sub you know from the dimensions
' how to multiply to get the position of the element
' and also the upper bounds
' if you want to access some element
' as my2DArray(7,5)
Local pPosition as Dword = Pointer + ((7 * XDims + 5 ) - 1) * SizeOf(myType)
' why -1 ?
' because Pointer is already at Element 1,1, so subtract it
Local XX as myType At pPosition
' XX gives you access to element (7,5) of my2DArray inside this sub
XX.foo = 123
if XX.bar then '....
End Sub
But that will only work if no dynamic strings inside myType.
Bookmarks