I'm wondering what is the quickest way to fill arrays without using a macro or a function.
The quickest way I've found is:
Code: Select all
DataSection
arr:
Data.i @"this",@"is",@"a",@"test"
arrEnd:
EndDataSection
Dim arr.s(3)
CopyMemory(?arr, arr(), ?arrEnd-?arr)
For i=0 To ArraySize(arr())
Debug arr(i)
Next
Also, I wonder if it'd be possible to automatically resize the array while copying the data?
If I use a static array in a structure it does it, but not with the dynamic one.
Code: Select all
Structure sarr
s.s[0]
endStructure
CopyMemory(?arr, s.sarr, ?arrEnd-?arr)
Of course, something like array()=("this","is","a","test") would be a dream come true, but a man can dream, I guess.