The question is in the topic title.
The point is that the array is multidimensional !
Sorry if this is a stupid question.
If you write it like this (as we are used to doing for a one-dimensional array):
Code: Select all
Procedure SomeProc(Array try(1,1))Further...
chatgpt suggests this to me (via poke and peek):
Code: Select all
Procedure.i Create2DArray(width, height)
*mem = AllocateMemory(SizeOf(Integer) * width * height)
For x = 0 To width - 1
For y = 0 To height - 1
PokeI(*mem + (x * height + y) * SizeOf(Integer), x * 100 + y)
Next
Next
ProcedureReturn *mem
EndProcedure
width = 3
height = 4
*matrix = Create2DArray(width, height)
For x = 0 To width - 1
For y = 0 To height - 1
Debug PeekI(*matrix + (x * height + y) * SizeOf(Integer))
Next
Next
FreeMemory(*matrix)
Thanks in advance.


