[Lazarus] controling a loop

Maxi maximiliano.duarte at gmail.com
Wed Aug 10 16:01:54 CEST 2016


CheckBox.Click(Sender:TObject);
begin
  repeat
    Some Action …

    Appication.ProcessMessage;

  until (CheckBox.State <> checked)
end;

2016-08-10 10:56 GMT-03:00 Schindler Karl-Michael <
karl-michael.schindler at web.de>:

> Hi.
>
> I want to control the execution of a loop with a checkbox. If the checkbox
> is checked the loop should run, if it is unchecked no action. I tried this
> with onClick:
>
> CheckBox.Click(Sender:TObject);
> begin
>   repeat
>     Some Action …
>     Form.Update;
>   until (CheckBox.State <> checked)
> end;
>
> The loop starts, but i cannot click the Checkbox again for switching off.
> How to do it? Is it possible without threads?
>
> Michael.
> --
> _______________________________________________
> Lazarus mailing list
> Lazarus at lists.lazarus-ide.org
> http://lists.lazarus-ide.org/listinfo/lazarus
>



-- 
El que pregunta aprende, y el que contesta aprende a responder.

No a la obsolecencia programada:
http://www.rtve.es/noticias/20110104/productos-consumo-duran-cada-vez-menos/392498.shtml

Linux User #495070
http://domonetic.com/blog
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20160810/5a0a9840/attachment.html>


More information about the Lazarus mailing list