Imports System
Imports Microsoft.VisualBasic
Class MyArrayRankSample
Public Shared Sub Main()
Try
Dim myArray(,,) As Integer = {{{1, 2, 3}, {3, 7, 3}}, {{9, 4, 1}, {3, 7, 3}}}
Dim myType As Type = myArray.GetType()
Console.WriteLine(myType.GetArrayRank())
Catch e As NotSupportedException
Console.WriteLine("NotSupportedException raised.")
Console.WriteLine(("Source: " + e.Source))
Console.WriteLine(("Message: " + e.Message))
Catch e As Exception
Console.WriteLine("Exception raised.")
Console.WriteLine(("Source: " + e.Source))
Console.WriteLine(("Message: " + e.Message))
End Try
End Sub
End Class