Weird Array problem (?)

DR00ME

Well-known member
Joined
Feb 6, 2004
Messages
169
Location
Finland
Dim R(76800) As Byte

once I have inserted stuff in the array I clear it with:

Array.Clear(R, 0, 76800)

next time I try to put stuff in it -> indexOutOfRangeException. So am I clearing the array in a wrong way or what ? Help needed.
 
how are you trying to add items back to the array? ie : to what index?
i just did this simple test which worked fine ...
Code:
        Dim R(76800) As Byte
        R(0) = 123
        MessageBox.Show(R(0)) /// first value
        Array.Clear(R, 0, R.Length) /// clear all values
        R(0) = 222
        MessageBox.Show(R(0)) /// second value
 
Problem solved, I had this Integer indexcounter overflowing.... thx anyway!
 
Last edited by a moderator:
Back
Top