Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
2D Array Errors
#2
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:

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
Reply


Messages In This Thread
2D Array Errors - by raymondlesley - 02-13-2025, 03:42 PM
RE: 2D Array Errors - by boriel - 02-16-2025, 04:05 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)