I haben't ever seen property of array ".length()".
Anyway : Dim BlockList(..) As String - each element of the string array has preset value the empty string ""
Dim BlockList(..) As Integer, same way default value is zero.
Maybe you want this: msgbox UBound(BlockList) that gives the upper bound of the array. If it is i.e. 6 the indexs are 0 to 5. If it's 0 there is no array
You can store only one string value, so why not use a simple string variable?
Now you could tell me that with this (dim myarr(0) as string) you can have a dynamically increased/decreased size array: ReDim Preserve myarr(5) as string !
UBound does not return how many values there is in the array. UBound gives the Upper Boundary of the array.
Depending on your option base (or the way you declared your array) you can use it to determine how many values are in the array... but it is not reliable.
There has been a discussion in full on this forum (I believe even more than once) on how to correctly get the number of elements in the array. See thread222-836312
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.