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