[an error occurred while processing this directive]
|
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Label1: TLabel;
procedure StartLoop();
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
var
canceled : boolean = true;
procedure TForm1.StartLoop();
begin
canceled := false;
while 1 = 1 do
begin
Application.ProcessMessages;
Label1.Caption := TimeToStr(Time);
if canceled then break;
end;
Label1.Caption := 'Ok';
Button1.Caption := 'Start';
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
if canceled then
begin
Button1.Caption := 'Stop';
StartLoop();
end else
begin
canceled := true;
end;
end;
end.
E-mail: info@telesys.ru