var Interrupt:boolean;
procedure TForm1.Button5Click(Sender: TObject);
begin
memo1.Lines.Add('Button5Click OK');
Interrupt:=true;
end;
procedure TForm1.Button6Click(Sender: TObject);
var i,j,n:integer;
begin
Interrupt:=false;
for i:=0 to 10000 do
for j:=0 to 10000 do
begin
inc(n);
Application.ProcessMessages;
if Interrupt then
begin
memo1.Lines.Add('Interrupt OK');
exit;
end;
end;
memo1.Lines.Add('Button6Click OK');
end;