VB Migration Partner supports the ArrayRank, which allows you to specify the rank of an uninitialized multi-dimensional array:

    Sub Test(arr() As String)
         '## arr.ArrayRank 2
         '...
    End Sub

which is converted to VB.NET as follows:

    Sub Test(ByRef arr(,) As String)
         '...
    End Sub

(Notice that you never need this pragma if the array is initialized by means of a Dim or a ReDim statement.)

In most applications you don't need to use this pragma often, because most arrays are just 1-dimensional vectors. However, there are exceptions. For example, a few days ago we upload the Waves project to our Code Sample section. This VB6 application does a lot of 3D graphcis and uses a lot of 2-dim arrays. All these arrays appeared as parameters of methods and forced us to insert as many as 30 ArrayRank pragmas. I began to wonder whether VB Migration Partner could do better than that, and automatically imply the rank of an array by some other hints and evidences. Actually, the job was relatively simple and it took me about one hour to implement it.

In the next beta release (version 0.93), VB Migration Parter can imply the rank of an array in manydifferent ways:

1) if your code accesses an element in the array, the code analyzer can just count the number of indices. For example, in this code snippet arr is clearly a 2-dim array:

    Function GetElement(arr() As String) As String
         GetElement = arr(0, 0)
    End Sub

2) if an array whose rank is know is assigned to another array whose rank isn't known - or viceversa - the rank of the unknown array can be deduced from the rank of the known array. In following example, the rank of the arr2 array can be deduced as being equal to 2,that is the rank of the arr array (which in turn was implied by the indexing operation:

    Sub Test(arr() As String, arr2() As String) 
         arr(1,2) = "abc"
         arr2 = arr
    End Sub 

A special case of this rule is when your code assigns the return variable of a Function or Property Get procedure; in the following example VB Migration Partner can deduce that the array returned by EvalArray is 2-dim:

    Function EvalArray(arr() As String) As String()
         arr(1,2) = "abc"
         EvalArray = arr
    End Sub 

3) if your code passes an array whose rank is known to a parameter array whose rank isn't known, then VB Migration Partner can deduce the rank of the parameter. For example, in this code rank of the vector parameter is unknown. However, the arr array (whose rank can be evaluated and is equal to 2) is passed to the vector parameter, therefore the rank of vector can be deduced to be equal to 2 as well:

    Function GetElement(arr() As String) As String
         Test arr
         GetElement = arr(0, 0)
    End Sub

    Sub Test(vector() As String) 
         ' ...
    End Sub

4) if an array whose rank is unknown is passed as an argument to a parameter whose rank is known, then VB Migration Partner can deduce the rank of the array passed as an argument. In the following example, the code analyzer can deduce that arr is a 2-dimensional array, and then implies that arr2 is also a 2-dim array because it is passed to the arr parameter.

    Sub Test(arr() As String) 
         arr(1,2) = "abc"
    End Sub 

    Sub Test2(arr2() As String) 
         Test arr2
    End Sub

5) the rank of an array that is being assigned the value returned by a Function or Property can be deduced if the rank of the Function/Property is also known. In the following case, the rank of the arr2 variable can be found equal to 2 because it is implied by the rank of the EvalArray function, which in turn was deduced by the assignment of the arr variable to the return EvalArray variable:

    Function EvalArray() As String()
         Dim arr(1,2) As String
         EvalArray = arr
    End Sub 

    Sub Test(arr() As String) 
         arr2 = EvalArray()
    End Sub 

Note: technique #5 can fail under certain circumstances, because it depends on the order in which methods and files are parsed. (It always works if the Function/Property is located previously in the same file.) Ensuring that it works under all circumstances would require that the parser be revised in depth, but I don't think the result would be worth the effort.