Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Loop never stops
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00967910
Message ID:
00967916
Views:
19
>Hi Hugo
>actually there is no other loop inside this do while loop but this loop inside another loop.
>i just put a wait window before enddo on llcancel but llcancel never getting .T. that means program not taking my key board input no matter how many times i press ESC or INS.
>
>DO WHILE .T.
>* allow ESC or insert (for dev) to cancel seach
>lnKey = INKEY()
>IF lnKey = 27 OR (gldevelop AND lnkey = 22)
>llCancel = .T.
>EXIT
>ENDIF
>---code here
>**** more code here
>WAIT WINDOW NOWAIT "llcancel value is "+TRANSFORM(llCancel) && new code
>ENDDO


Do you have
>IF llCancel
> EXIT
>ENDIF
in the outer loop too?

I just ran this code as test, and worked as expected:
local lnStart, llCancel, lnKey

set escape off
lnstart = Seconds()
do while .t. and (Seconds() - lnStart < 5)
	lnKey = Inkey()
	if lnKey = 27
		llCancel = .t.
	endif
	if llCancel
		exit
	endif
enddo
? llCancel
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?

"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare

"To die for a religion is easier than to live it absolutely"
Jorge L. Borges
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform