title: VB.net For loop wrong i
body: <p>I don't know what or why it is happening. In the code below at the first run i = 0. Working fine. At the end i = 2. Also fine. But then, for some reason that I can't comprehend, suddenly i = 3. This gives an System.ArgumentOutOfRangeException, which I understand, since there are only 4 items in the list.</p>
  <p>How does change i from 2 to 3?</p>
  <pre><code>noOfSpeedLimiterPositions = speedLimiterPositions.count() '= 4
      
  For i = 0 To noOfSpeedLimiterPositions - 1
      speedLimiterPosition = speedLimiterPositions(i)
      nextSection = speedLimiterPosition + speedLimiterPositions(i + 1) 'exception thrown here
          
      While speedLimiterPosition &lt; nextSection
          rollerSpeedLimiterPositions.add(speedLimiterPosition)
          speedLimiterPosition = speedLimiterPosition + 57.5 * 2
      End While
      MessageBox.Show(i) 'shows 0
      i = i + 2
      MessageBox.Show(i) 'shows 2
  Next
  </code></pre>