Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How can I tell what the last pressed key is?
Message
De
08/05/2001 09:23:07
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00504620
Message ID:
00504649
Vues:
19
>>Ron,
>>inkey(0.1) means wait for a key for 0.1 seconds at max, not wait 0.1 secs before checking a key. You'd need a loop as you did to enforce it, however using seconds() is dangerous if this routine could be running around midnight (SECONDS() - pnseconds > pntimeout would be true about 24 hrs later).
>>
>
>Also, you can use
>pnseconds = DATETIME()
>IF DATETIME() - pnSeconds > pntimeout
>...
>
>or for more precise values (or in FoxPro 2.5)
>pnseconds = VAL(SYS(1)) * 86400 + SECONDS()
>instead of DATETIME()

Yes Nick,
Second is better. Datetime() can't resolve small amounts.
(Actually I would use a C based timer like Bela Bodec's cpptimer to be precise enough:)
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform