Danke Günter.
Delphi-Quellcode:
procedure TForm1.A;
var
stopped: Boolean;
begin
stopped := false;
while not stopped do
begin
try
TTask.CurrentTask.CheckCanceled;
except
on EOperationCancelled do
stopped := true;
end;
sleep(10);
end;
end;
procedure TForm1.B;
var
i: Cardinal;
stopped: Boolean;
begin
stopped := false;
while not stopped and not TThread.CurrentThread.CheckTerminated do
begin
try
TTask.CurrentTask.CheckCanceled;
except
on EOperationCancelled do
stopped := true;
end;
sleep(50);
inc(i);
TThread.Queue(TThread.CurrentThread, procedure
begin
edit1.Text := format('%d %d',[integer(TThread.CurrentThread), i]);
end);
end;
end;
ich denke, ich werde es dann so machen.
Grüße
Klaus