40/5000
Deeply grateful for the help given.
Sorry for the absence. Larger forces.
I tried Break, but I was not very happy. Maybe he acted inappropriately. I'll try one more time.
I will put a practical, simplified example below. A counter loop with a delay of 1s, which alternates the color of a shape at each pass. If it works correctly, the problem will have a similar solution.
procedure TForm1.Button1Click(Sender: TObject);
var
i: integer;
begin
For i:=0 to 10 do
begin
if shape1.brush.color = clwhite then
shape1.brush.color := clblack else
shape1.brush.color := clwhite;
delay(1000);
end;
end;