Code: Select all
Dim MyArray.l(1) ; We have 2 elements
Debug "ArraySize(myArray()) = " + ArraySize(myArray()) ; reports 1, which is the upper bound, not the size
Dim anotherArray.l(0) ; We have 1 element, therefore size of the array is 1
Debug "ArraySize(anotherArray()) = " + ArraySize(anotherArray()) ; the function reports 0 ! should be 1
Still, for the sake of clarity, this function should be renamed ArrayLimit() or ArrayLast() or ArrayBound() or anything but ArraySize().