-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.pas
51 lines (42 loc) · 950 Bytes
/
main.pas
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
unit main;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ExtCtrls, Vcl.StdCtrls;
type
TForm_main = class(TForm)
Button1: TButton;
Memo1: TMemo;
procedure Button1Click(Sender: TObject);
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
private
running: boolean;
public
{ Public-Deklarationen }
end;
var
Form_main: TForm_main;
implementation
{$R *.dfm}
procedure TForm_main.Button1Click(Sender: TObject);
begin
if not running then
begin
running := true;
self.Button1.Caption := 'stop';
while running do
begin
Application.ProcessMessages;
end;
end
else
begin
running := false;
self.Button1.Caption := 'start';
end;
end;
procedure TForm_main.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin
running := false;
end;
end.