The "Length" member returns the declared size of an array, not the number of elements inside. I need to sift through various arrays and compare their element count to avoid doing unnecessary work. For now, I made a small function:
int Function getElementCount (arrayType[] array) int counter = 0 while (array[counter]) counter += 1 endwhile return counterEndFunction
But it has two disadvantages: It only works for a single data type and it creates extra overhead depending on the array size and quantity.
Is there a built-in way of obtaining the pupulated elements in an array?
Thank you.