All pastes #57343 Raw Edit

Anonymous

public text v1 · immutable
#57343 ·published 2006-05-20 19:31 UTC
rendered paste body
  if OpenDialog1.Execute then
  begin
    i := 1;

    TmpStringList := TStringList.Create;

    AssignFile(fopen, OpenDialog1.FileName);
    Reset(fopen);
    try
      while not SeekEof(fopen) do
      begin
        ReadLn(fopen, s);

        TmpStringList.CommaText := s;

        if TmpStringList.Count > StringGrid1.ColCount then
        begin
          StringGrid1.ColCount := TmpStringList.Count;
        end;

        StringGrid1.RowCount := i + 1;

        StringGrid1.Rows[i].Assign(TmpStringList);

        Inc(i);
      end;
    finally
      TmpStringList.Free;
      CloseFile(fopen);
    end;
  end;