Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
The Great ESC?
Message
From
24/04/1999 15:38:01
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00209813
Message ID:
00211920
Views:
30
>>This has the same not-so-subtle bug as my example; if the table is empty, the INKEY() is never evaluated.. In addition, the scan continues to EOF if the Esc key is pressed, rather than aborting immediately.
>>
>>>Sincerely,
>
>Try modified version:
>
>lIsRun = .T.
>DO WHILE lIsRun
> SCAN While lIsRun
> IF INKEY() = 27
> lIsRun = .F.
> ELSE
> ... my main code is here
> ENDIF
> ENDSCAN
> lIsRun = (Inkey()#27)
>ENDDO

This will work if there are two ESC characters in the keyboard buffers - one to be eaten by the inkey() within the Scan loop, and the other one for the inkey() in the Do While loop. It will suffice to change the last lines to
   ENDSCAN
   lIsRun = (Inkey()#27) and lIsRun && here we use the inner one
ENDDO

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform