Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Some function?
Message
De
08/10/2002 17:22:25
 
 
À
08/10/2002 16:43:42
Fabian Belo
Independent Developer
Argentine
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00709013
Message ID:
00709048
Vues:
18
>VFP 6.0: Is there any function to display if my string is non numeric?
>ie:
>string: 123RTY234 (non numeric)
>string: FHE1234 (non n)
>string: 121345 (numeric)
>
>IsDigit() look only the first char...
>Val() returns zero if first char. is alphab.
>
>I would like to know if there is any NATIVE FUNCTION, if not.... I have to create one.

I can think of a couple, if you ignore the possibility of a multiplicity of decimal points, the simple LEN(CHRTRAN(ALLTRIM(MyStringToTest),'-0123456789.',''))=0 indicates a 'legal' numeric content; additional rules as to the position of a sign, the existance of no more than a single decimal point, the possibility of a scientific notation in a numeric, etc.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform