Ubound
ubound method is used to count the length of array. It returns the highest index number of the array.
But remember, the actual size of the array is highest index number plus one!!
But remember, the actual size of the array is highest index number plus one!!
Eg : Dim myArray(4)
msgbox ubound(myArray) '4
msgbox "size="&ubound(myArray)+1 'size=5
Eg: Dim myArray(4,6)
msgbox ubound(myArray, 1) ' highest index of the first dimension - 4
msgbox ubound(myArray, 2) ' highest index of the second dimension - 6
msgbox ubound(myArray, 1) ' highest index of the first dimension - 4
msgbox ubound(myArray, 2) ' highest index of the second dimension - 6
No comments:
Post a Comment