Size(array)The function returns the size of continuos one-dimensional array associated with a variable. It assumes that an array is 1-based and do not have null elements. Example:
array[1] = 1 array[2] = 2 array[3] = 3 n = Size(array) ' it is 3Here is another example with an array which is 0-based, and not continous. The function only couts continuos items starting from 1:
array[0] = 1 ' not counted, because it's index is 0 array[1] = 1 array[2] = 2 array[3] = 3 array[4].member = 4 ' it is counted, array[4] is null, but it has a member array[5][5] = 5 ' it is counted, array[5] is null, but it has it's own array assigned array[7] = 7 ' it is not, because 6-th item is missing array["something"] = "something" ' it is not counted, because it's index is not integer n = Size(array) ' it is 5
See also: