Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Validing Keystrokes in an Input field
Message
De
13/01/2000 10:05:02
Nancy Folsom
Pixel Dust Industries
Washington, États-Unis
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00317341
Message ID:
00317591
Vues:
11
SECOND TRY. Forgot to send copy to Mathias. Mea culpa.

Mathias (via Jim's post)-

>>Valid Characters are in are "ABCD12340.()+"
>Mathias,
>
>In the KeyPress put this code;
>
>
IF NOT CHR(nKeyCode) $ "ABCD!@#$).()+"
>   ?CHR(7)   && Beep
>   NODEFAULT && Ignore key stroke
>ENDIF
>
One nice thing about going this route, rather than using INLIST() is that it's more flexible for future changes (IMO).

IOW, you might want to consider storing the valid character string in, perhaps, a form property or even a field in an appliction options table so that if you need to change the string, it's easy. Also, so that if you need access to it in more than one place, you have it available throughout your code without having to remember what it is.

A #DEFINE would also be an approach.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform