title: List index out of bounds whilst deleting items
body: <p>I solved my problem but I need to know why this problem raised to me ?!</p>
  
  <p>I write a project that load file to listBox then delete the strings one by one,</p>
  
  <p>but when I delete listBox strings this exception raised to me!</p>
  
  <p><strong>list index out of bounds (5) !</strong></p>
  
  <p>I type this for loop to read list box and delete strings:</p>
  
  <pre><code>for i := 0 to ListBox3.Count -1  do
    begin
        ShowMessage(ListBox3.Items[i]);
         ListBox3.items.Delete(i);
    end;
  </code></pre>
  
  <p>and my problem solved by do a little change in for-loop statement</p>
  
  <pre><code>for i := ListBox3.Items.Count - 1 downto 0 do
    begin
        ShowMessage(ListBox3.Items[i]);
         ListBox3.items.Delete(i);
    end;
  </code></pre>
  
  <p>Why the first statement raised an exception, and the second one work fine ?</p>