VB.Net array Class

L

Lisa

Can anybody tell me what's the problem with this code?

Class CRate
public mRate as double
public mValue as double
end class

Class CBox
public bNo as long
public bRate as CRate()
End Class

======================

Private Sub Test()
Dim J as long
Dim BoxRead as CBox = New CBox(9) {}

For i = 0 to 9
BoxRead(i).bNo = i
BoxRead(i).bRate = New CRate(5) {}
For j = 0 to 5
BoxRead(i).bRate(j).mRate = (i * 12) + j
BoxRead(i).bRate(j).mValue = (i * j)
next j

next i

For i = 0 to 9
For j = 0 to 5
msgbox (BoxRead(i).bRate(j).mRate ) '<=== Error ?!
BoxRead(i).bRate(j).mValue
next j
next i

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top