Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do I check a string for a number?
Message
De
05/08/2004 07:54:02
 
 
À
05/08/2004 07:46:49
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00930934
Message ID:
00930936
Vues:
13
Try this:
Function GetNum
LPARAMETERS lcString as Character 
RETURN VAL(CHRTRAN(lcString,CHRTRAN(lcString,"0123456789",""),""))
?GetNum("A114")




>Hi there,
>
>I'm working on a VFP 7.0 application and need to evaluate a string to see if certain characters in it are letters or numbers. For instance, I may have "A114" or "AR0559" as my string. I need to parse the string, separating the letters from the numbers (the letters will always come first, followed by several numbers).
>
>Is there a quick way to do this in VFP?
>
>Thanks much,
>






>Joe
Peter Cortiel
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform