Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Numeric or string ??
Message
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 7
OS:
Windows XP
Database:
MS SQL Server
Miscellaneous
Thread ID:
00985094
Message ID:
00985113
Views:
41
>>Hello,
>>
>>a simple question and I hope to find a simple answer:
>>
>>I want to test if the input in a textbox is numeric or character. How can I determine that for example '123 piano' is character and not numeric (using the val() function returns 123.00) ??
>>
>>Greetz,
>>Hans
>
>
?empty(strtran(chrtran(lcString,"-1234567890.","999999999999"),"9",""))
>
>assuming your separator is .

But I think Yuri's answer is better since mine doesn't take into account scientific notation or hexadecimal.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform