Click here to Skip to main content
15,887,214 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello every body.
I have a Two-dimensional array. How to find the size of array?
Posted

1 solution

Hi,

please try the following code to get the two dimensions for your array
VB.NET:
VB
Dim dimensionOne As Integer = myArray.GetLength(0)
Dim dimensionTwo As Integer = myArray.GetLength(1)

For VB6, you can use the UBound function as described here:
http://msdn.microsoft.com/en-us/library/95b8f22f%28v=vs.90%29.aspx[^]
 
Share this answer
 
v2
Comments
taghit 7-Sep-12 5:42am    
Thank U to read my question.
your answer work in VB.NET but i shoud wirte it in vb6 so vb6 hasn't "GetLength" array.
JF2015 7-Sep-12 5:45am    
I updated the answer to show the solution for VB6.
Espen Harlinn 7-Sep-12 8:32am    
5'ed!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900