[Implemented] GetArraySize and GetArrayElements
Posted: Wed Feb 15, 2006 6:44 pm
Sorry if I have overlooked this, but I cannot find something equal to
CountList for arrays!
Even if I think CountList should be renamed to ListCount, I wish something
like this for arrays, too! It is very important for arrays as parameters!
Add these macros (or functions) by default:
Or at least ensure that they are correct 
CountList for arrays!
Even if I think CountList should be renamed to ListCount, I wish something
like this for arrays, too! It is very important for arrays as parameters!
Add these macros (or functions) by default:
Code: Select all
Macro GETARRAYSIZE(Array)
PeekL(arr() - 8) * PeekL(Arr() - 20)
EndMacro
Macro GETARRAYELEMENTS(Array)
PeekL(arr() - 8)
EndMacro
Procedure test(arr.q(1))
Protected Dim arr2.q(GETARRAYELEMENTS(arr()) - 1)
CopyMemory(arr(), arr2(), GETARRAYSIZE(arr()))
For z = 0 To GETARRAYELEMENTS(arr2()) - 1
Debug arr2(z)
Next
EndProcedure
Dim array.q(20)
For z = 0 To 20
array(z) = z
Next
test(array())
