Change the following -For i = 0 To 31
to
For i = 0 To 30
Your index starts at zero, which is your first counter. You've referenced 31, but are calling 32 loops in your statements, hence the out of range error.
AndreRet
Senior Poster
3,922 posts since Jan 2008
Reputation Points: 334
Solved Threads: 350
My fault, should have seen it the first time around...
For i = 0 To 31
NumberA(i) = Val(NumberA_Char(i)) 'NumberA has no value set for it
NumberB(i) = Val(NumberB_Char(i))
Next
'Try the following
NumberA = 0
NumberB = 0
For i = 0 To 30
NumberA = i
NumberB = i
NumberA = Val(NumberA_Char)
NumberB = Val(NumberB_Char)
Console.ReadLine 'You should do something with the returned value before going to the next i...
Next i
AndreRet
Senior Poster
3,922 posts since Jan 2008
Reputation Points: 334
Solved Threads: 350
This was my error as well, Always use -1 to start at 0 in a for loop, sorry for not picking it up earlier.:)
Please mark this as solved at the bottom of the page, thanks.
AndreRet
Senior Poster
3,922 posts since Jan 2008
Reputation Points: 334
Solved Threads: 350