02-16-2025, 04:05 PM
Was that feature actually allowed in Sinclair Basic??
The error is expected. You cannot do that, only copying entire arrays (of the same dimension) onto another.
However it's a nice feature. Will thing of implementing it...
In the meantime, you can create a function to do this (arrays can be passed as parameters) or do it directly at low level:
The error is expected. You cannot do that, only copying entire arrays (of the same dimension) onto another.
However it's a nice feature. Will thing of implementing it...
In the meantime, you can create a function to do this (arrays can be passed as parameters) or do it directly at low level:
Code:
#include <memcopy.bas>
DIM data_array(0 TO 2, 0 TO 3) AS UByte = { _
{0, 1, 2, 3}, {4, 5, 6, 7}, {8, 9, 10, 11} _
}
DIM element12 AS UByte = data_array(1, 2)
DIM element0(0 TO 3) AS UByte
REM element0 = data_array(0) ' throws an error
MemCopy(@data_array(0, 0), @element0(0), 4)
---
Boriel
Boriel