title: Delphi access violation at address in module usp10.dll
body: <p>Ok here's the thing, my program runs perfect.. no errors at all until I add another button onto my form. </p>
  
  <p>I have a stringgrid in parallel with an array[1..200]. </p>
  
  <p>I have a delete button:</p>
  
  <pre><code>Procedure TForm1.DeleteTeam(TeamName: string);
  var
    i : integer;
  begin
    for i := 1 to TotalNumberOfTeams do
      begin
        if TeamName = SailingTeams[i].TeamName then
          begin
            sailingTeams[i].AvLapTime := 99999999;
            //puts one to delete with largest value to delete
            SortArray;
            //sorts it so it is at the end of array
            sailingTeams[TotalNumberOfTeams] := nil;
            TotalNumberOfTeams := TotalNumberOfTeams - 1;
            sortArray;
            UpdateGrid;
            Break;
          end;
      end;
  end;
  
  procedure TForm1.btnDeleteClick(Sender: TObject);
  var
    TeamName : string;
    continue : integer;
  begin
    TeamName := (strGrid.Cells[0,(strGrid.Row)]);
    continue := MessageDlg('Are you sure you wish to delete: '+teamName+'?',mtWarning, mbYESNO, 0);
    if continue = mrYES then
      DeleteTeam(TeamName);
  end;
  </code></pre>
  
  <p>If I add a button and click it, then click delete I get the error :S :S</p>
  
  <p>Just a home project for a 24 hour dingy race so efficiency of algorithms and stuff not important but any ideas as to why I'm getting this error?? :S</p>