1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94:
| unit Unit1;
interface
uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, Grids, ComCtrls;
type TForm1 = class(TForm) StringGrid1: TStringGrid; GroupBox1: TGroupBox; Button1: TButton; Button2: TButton; ProgressBar1: TProgressBar; Label1: TLabel; Button3: TButton; GroupBox2: TGroupBox; Edit1: TEdit; Label2: TLabel; Label3: TLabel; Label4: TLabel; StringGrid2: TStringGrid; procedure Button1Click(Sender: TObject); procedure FormCreate(Sender: TObject); procedure Button3Click(Sender: TObject); procedure Button2Click(Sender: TObject); private public end;
var Form1: TForm1; maxG : Integer ; c : Integer ;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject); var s,e : Real ; i,j,max : Integer ; begin inc(c); max := StrToInt(Edit1.Text); maxG := max ; ProgressBar1.Max := max ; S := GetTickCount ; for i := 1 to max do for j := 1 to max do begin StringGrid1.RowCount := i ; StringGrid1.ColCount := j ; StringGrid1.Cells[i-1,j-1]:=IntToStr(i*j); ProgressBar1.Position := i ; end; E := GetTickCount ; E := E-S ; Label4.Caption:=FloatToStr(E/1000)+' Sekunden'; StringGrid2.RowCount := c+1 ; StringGrid2.Cells[0,c]:=IntToStr(c); StringGrid2.Cells[1,c]:=FloatToStr(E/1000); StringGrid2.Cells[2,c]:=IntToStr(MaxG); end;
procedure TForm1.Button2Click(Sender: TObject); var i,j : Integer ; begin for i := 1 to maxG do for j := 1 to maxG do begin StringGrid1.Cells[i-1,j-1]:=''; end; end;
procedure TForm1.Button3Click(Sender: TObject); begin Form1.Close ; end;
procedure TForm1.FormCreate(Sender: TObject); begin ProgressBar1.Min := 0 ; StringGrid2.Cells[0,0]:='Run'; StringGrid2.Cells[1,0]:='Time'; StringGrid2.Cells[2,0]:='Max'; end;
end. |