Converting from VB6 to VB.net 3.5
I am converting my project from VB6 to VB.net 3.5 and
at one place i have declared private variable a() as variant
and i am using some place as b =a(index,0)
it will work in VB but gives me error in VB.Net
the error is Number of Indices exceeds the number of dimensions of the indexed array.
Please help me
Re: Converting from VB6 to VB.net 3.5
Can we see the code block? What is "index" declared as?
Re: Converting from VB6 to VB.net 3.5
yes here is the code in vb
Private a() As Variant
Public Property Get JobA() As Variant()
JobA = a
End Property
Public Property Get JobB(Index) As String
JobB = a(Index, 0)
End Property
Index is integer and get from other form
in VB.Net
Public ReadOnly Property JobB(ByVal Index) As String
Get
JobB = a(Index, 0)
End Get
End Property
i declare a in vb.net as Private a() As Object
it will give me error at a(index,0)
Re: Converting from VB6 to VB.net 3.5
Your line b = a(index, 0) is saying that a is mulitdimesional array where as the definition a() as variant states that it has a single dimension. You may just need to change the definition of the a array to something like Dim a(,) As Object, but as weirddemon says we could use a little code to help you better ...
Re: Converting from VB6 to VB.net 3.5
demausdauth...
i Tried Dim a(,) as object but it will gives me error in other function as i'm using a as single and two dimensional array