Some functions, such as Split(), return an array with -1 for the upper bound and zero for the lower bound if the array has no elements, for example:
Dim s() As String
s = Split("", ",")
Debug.Print UBound(s)
Debug.Pring LBound(s)
In this case, UBound (s) will be -1, and LBound (s) will be 0. I have a fair amount of code checking -1 at the top border to see if the array has values ββor not. This works great.
The problem is that now I want to change the data type of the array from a string to long. I cannot create an array of longs with an upper bound of -1 and a lower bound of 0, and the functions Split()and Join()only work with string arrays.
I would like to be able to return a long array with an upper bound of -1. Is it possible?
source
share