[Gambas-user] Closing a window in a DO LOOP

Benoit Minisini gambas at ...1...
Sat May 10 01:17:23 CEST 2008


On samedi 10 mai 2008, Pino Zollo wrote:
> Hi everybody,
> In a class  I have the following loop:
>
>  DO
>     GridVncdxf[Slot, 1].BackColor = &HEFFFBF&
>     T = Now
>     i = Minute(T) MOD 3
>     s = Second(T) DIV 10
>     Slot = ((i * 6 + s - nf) + 18) MOD 18
>     GridVncdxf[Slot, 1].BackColor = &HC5D5A6&
>     WHILE Second(Now) MOD 10
>       IF ByBeacon THEN EXIT
>       WAIT 0.5
>     WEND
>     IF ByBeacon THEN EXIT
>     WAIT 0.1
>  LOOP
>
> It happens that while the program is executing this loop I can not close
> the relative window and nither stop the program from  FMain. (Unless
> ByBeacon becomes TRUE, in which case the loop is ended and the window can
> be closed)
>
> In the IDE only I can stop the program  with the STOP button.
> Please how can I modify this piece of program to get a normal behaviour ?
> (Developing in GAMBAS 2.5)
>
> Thanks.
>
> Pino
>

You cannot close a window if you are not in the same event loop level than 
when you opened it. 

This is the case there, as by using WAIT, you automatically enter a new event 
loop.

I don't know what you want to do, but I suggest using timers if your actions 
depends on time.

Regards,

-- 
Benoit Minisini




More information about the User mailing list