_TITLE "Mem test for array copy" 'B+ 2019-09-06
' Don't forget _Memfree
DIM a
(1 TO 20), a1
(1 TO 20) AS STRING * 100 'cant do variable length strings , apparently not fixed strings either
sngArrCopy a(), bCopy()
FixStr100ArrCopy a1(), b1Copy()
'example Steve's for MemFill
_MEMFILL m
, m.OFFSET
, m.SIZE
, &HFFFE AS INTEGER '<--- Presto! It's now full with 10 values of 65535 (&HFFFF)
SUB sngArrCopy
(A!
(), copyB!
()) _MEMFREE m
'<<<<<<<<<<<<<<<<<<<<<<<<<< like freeimage very important
'this wont work C++ doesn't like it
'SUB FixStr100ArrCopy (A() AS STRING * 100, copyB() AS STRING * 100)
' REDIM copyB(LBOUND(a) TO UBOUND(a)) AS STRING * 100 'container for _memget is ready
' DIM m AS _MEM
' m = _MEM(A())
' _MEMGET m, m.OFFSET, copyB()
'END SUB
'Steve's fix for strings