size of multidimensional dynamic array
Where is the code that made gInfo(1) an array? It isn't in your post,
and VBA also seems to think that gInfo is not an array. And in any
event, gInfo is declared as a 2-D array, so gInfo(1) doesn't refer to
anything, unlike gInfo(0,1) or gInfo(1,0) or gInfo(1,1).
If all the code being executed is
Dim gInfo() As String
ReDim gInfo(0 To 1, 0 To 1)
iSize = UBound(gInfo(1))
then gInfo is not an array of arrays, and you should change gInfo(1) to
gInfo,2.
Alan Beban
ThatFella wrote:
Having created a dynamic, multidimensional array like so:
Dim gInfo() As String
ReDim gInfo(0 To 1, 0 To 1)
I understand that you can only change the size of the last dimension.
Once having created an array, though, how do you find the size of this
second dimension?
The following line would not compile ("expected Array"):
iSize = UBound(gInfo(1))
I expected gInfo(x) to return the xth array in this "array of arrays".
Is this not so in VBA? How then do you get the size of the second
dimension? Thanks in advance.
|