[Gambas-user] Re : How to interrupt a loop ?

serge bouc serge.bouc at ...402...
Thu Sep 28 17:54:21 CEST 2006


nando wrote :
> I had the same problem...here's how I did it
>
> I wanted as much CPU for the processing
> minimize event processing
> and only to test the STOP button occasionally
>
> (example may not sytatically correct)
>
>
> 1) Have a global boolean
> 2) Have a click button to 'stop'
> 3) Inside your computations Increment an integer
>    and every million increments perform a WAIT
> 4) The WAIT will let the interpreter catch events
>    and if the stop button was pressed ACTIVE is set TRUE
> 5) somewhere else in you computations look for ACTIVE = TRUE to quit.
>
> -Fernando
>
>   
It works !  The key was to use "WAIT" to catch events...
(once again, the Gambas documentation is rather obscure
on this subject...)
Many thanks for this idea !
Serge.






More information about the User mailing list