|
-
Jan 21st, 2010, 09:42 AM
#1
Thread Starter
Member
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
-
Jan 21st, 2010, 10:13 AM
#2
Re: Converting from VB6 to VB.net 3.5
Can we see the code block? What is "index" declared as?
CodeBank contributions: Process Manager, Temp File Cleaner
 Originally Posted by SJWhiteley
"game trainer" is the same as calling the act of robbing a bank "wealth redistribution"....
-
Jan 21st, 2010, 10:23 AM
#3
Thread Starter
Member
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)
-
Jan 21st, 2010, 10:26 AM
#4
Addicted Member
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 ...
If someone has helped you, please make sure to rate them. 
-
Jan 21st, 2010, 10:31 AM
#5
Thread Starter
Member
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|