unit timer;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ExtCtrls, StdCtrls, Grids, Menus;
type
TForm1 =
class(TForm)
Button2: TButton;
Edit1: TEdit;
Label1: TLabel;
Timer1: TTimer;
StringGrid1: TStringGrid;
Edit2: TEdit;
Button1: TButton;
procedure Timer1Timer(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private-Deklarationen }
public
zae , zae2 , stunden , mins , secs : integer ;
vFeld :
array[1..2,1..1000]
of string ;
vNum :
array[1..1000]
of string ;
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.Timer1Timer(Sender: TObject);
begin
inc(secs);
if secs >=60
then
begin
inc(mins);
secs := secs-60 ;
if mins >=60
then
begin
inc (stunden);
mins := mins-60;
end;
end;
Edit1.Text := inttostr(Stunden) + '
:' + inttostr(mins) + '
:' + inttostr(secs) ;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
inc (zae);
vFeld[1,zae] := inttostr(zae);
vFeld[2,zae] := Edit1.text;
Stringgrid1.cells[0,zae] := vFeld[1,zae];
Stringgrid1.cells[1,zae] := vFeld[2,zae];
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
stunden := 0;
mins := 0;
secs := 0;
zae := 0;
zae2 :=0;
Edit1.Text := inttostr(Stunden) + '
:' + inttostr(mins) + '
:' + inttostr(secs) ;
Stringgrid1.cells[0,0] := '
Platzierung';
Stringgrid1.cells[1,0] := '
Zeit';
Stringgrid1.cells[2,0] := '
Startnummer';
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
inc(zae2);
vNum[zae2]:= Edit2.text;
Stringgrid1.cells[2,zae2] := vNum[zae2];
Edit2.clear;
end;
end.