Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Inkey() returns only 0
Message
De
19/07/2008 11:10:11
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
19/07/2008 03:55:44
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01332212
Message ID:
01332507
Vues:
12
>>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.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform