Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Checking for characters
Message
De
03/12/1997 16:13:33
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00063081
Message ID:
00063627
Vues:
67
>I couldn't find the key codes for (') and ("), so I used the following code >in the valid method of the textbox: Just issue (from the command window) a simple?inkey(0)and type the apostrophe, and then repeat it for the quote (quote is 34, AFAIK, and 39 is the apostrophe). >Local temptext > >temptext = occurs("'",this.value) > >if temptext>0 >=messagebox("This field cannot contain the (') >character!",16,osys.Appname) >this.value = "" >thisform.refresh() >ENDIF > >That takes care of the ('), but not the ("). Oh well, I'll stick with this >for now unless someone knows where to find these key codes. Sure it takes care, but also annoys the user, by deleting the original text issued. Try this: if temptext>0 this.value = chrtran(this.value, chr(34)+chr(39), "") thisform.refresh() wait "Apostrophes and quotes removed" window nowait ENDIF

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform