Try adding a call to DOEVENTS() inside the loop.
x = 1
do while .t.
if x = 0
exit
endif
x = x + 1
<b>doevents()</b>
enddo
>Hi Everyone!
>
>I have a question: I need to break a eternal cicle (Do While) with a call from a specific key (F1, for example). I´d tried that way:
>
>In command1.click
>
>x = 1
>do while .t.
> if x = 0
> exit
> endif
> x = x + 1
>enddo
>
>In command.keypress
>LPARAMETERS nKeyCode, nCtrlAltShift
> If nKeyCode = 28
> x = 0
> @1,1 Say "HELLO"
> endif
>
>
>If I press F1 before click on the button, everything it´s ok and I can see the HELLO Message. But how can I do to take the F1 key while the cicle is running?
>Is it there another way to do that?
>
>Thanks in advance
Hector Correa