Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to trap only alpha numeric in keypress event
Message
 
 
To
12/04/2004 03:12:50
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00893956
Message ID:
01454993
Views:
58
>>i have a keypress event that i want to show message when user presses any alpha numeric including special characters.
>>
>>i tried trapping the esc, tab, all arrows, page down and up etc. but it's a bit tedious considering i have to trap all the function keys too.
>>
>>how do i do that? TIA
>
>hi Evelyn,
>
>For alphanumeric, you can use between().
>As to function keys and other special keys, they are the hardest part and have to be tested separately, which is normal since each one will require a distinct action
>
>Success,
>
>
>do case
>case	        ( inlist(nShiftAltCtrl, 0) and between(nKeyCode, asc('0'), asc('9')) ) ;
>	or	( inlist(nShiftAltCtrl, 0) and between(nKeyCode, asc('a'), asc('z')) ) ; 
>	or	( inlist(nShiftAltCtrl, 1) and between(nKeyCode, asc('A'), asc('Z')) )
>	
>	acti screen
>	?'alphanum', chr(7)
>
>endcase
>
Thanks, this is useful.

For my task, though, using 'N' in InputMask will work.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform