Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to trap only alpha numeric in keypress event
Message
 
 
À
12/04/2004 03:12:50
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00893956
Message ID:
01454993
Vues:
59
>>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform