Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Inkey() causes Function argument value, type, or count is in
Message
From
09/11/1999 13:44:59
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Title:
Inkey() causes Function argument value, type, or count is in
Miscellaneous
Thread ID:
00289136
Message ID:
00289136
Views:
216
I want to allow user to stop my program using Esc key.
So I added a lines

IF INKEY()=27

into many places in my program.

In fp dos and in fpw it works ok.
However, in vfp 5 build 415 runtime (havent tried other vfps)
this line causes sometimes Visual Foxpro error 11

Function argument value, type, or count is invalid.

This behaviour is reported also by some other person here in UT.

So I replaced all calls to inkey with the following function

* Returns .t. is Esc is pressed
FUNCTION MYINKEY
PRIVATE tul
ON ERROR NOTE && ignore inkey error
tul = INKEY()
DO seterror && sets my standard error handler
IF TYPE('m.tul')!='N'
RETURN .F.
ENDIF
RETURN m.tul == 27

This eliminates most inkey() errors, but not all.
Sometimes this function continues to cause an error

Function argument value, type, or count is invalid.

Is this foxpro bug, maybe related to keyboard driver?
It it possible to dedect pressing escape key by some other vfp function or by windows API call ?
Andrus
Next
Reply
Map
View

Click here to load this message in the networking platform