Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Some function?
Message
From
08/10/2002 17:22:25
 
 
To
08/10/2002 16:43:42
Fabian Belo
Independent Developer
Argentina
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00709013
Message ID:
00709048
Views:
17
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform