I hope this can be of help or inspiration.
I use the Lazarus flavor of pascal:
With one form with just one timer and one label (for showing the time) the whole no class quick example looks like this:
unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls, StdCtrls;
type
{ TForm1 }
TForm1 = class(TForm)
Label1: TLabel;
Timer1: TTimer;
procedure FormCreate(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
private
public
end;
var
Form1: TForm1;
iSeconds: integer;
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1.Timer1Timer(Sender: TObject);
begin
iSeconds := iSeconds + 1;
label1.Caption := IntToStr(iSeconds) + ' seconds counted.';
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
iSeconds := 0;
end;
end.
Bookmarks