Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Inkey() returns only 0
Message
From
19/07/2008 11:10:11
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01332212
Message ID:
01332507
Views:
13
>>So... give it a zero for a parameter, or else it won't wait, and your chances of lifting your finger off a key at exactly the right moment are pretty much nil.
>
>Also from help: Returns a number corresponding to the first mouse click or key press in the type-ahead buffer.
>
>So since INKEY() is picking up the value from the buffer if there's nothing there then it's because other processing has not allowed the OS time to process the keystroke

There's that. Also, in the code presented here, inkey() was called twice, thereby eating two keystrokes. IOW, calling inkey() doesn't just detect that there's something in the buffer -- it consumes it as well. ChrSaw() is the function to detect there's something there. I've generally found it useful to store anything that inkey() may return into a variable, so it doesn't get lost.

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