Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Numeric or string ??
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 7
OS:
Windows XP
Database:
MS SQL Server
Divers
Thread ID:
00985094
Message ID:
00985113
Vues:
40
>>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform