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:
00985174
Vues:
52
>When the user puts in just digits, I know it's numeric. If he puts in just characters, I know it's a string. But how do I know that when the user puts in '123 piano' that it is character if the type() function returns 'U' and the val() function return 123.00 (sugesting it is numeric). What I do now is I test each character separately, but I want to know if there is no other, easier way.

As you said, it's always character string but if type() function returns "N" it represents numeric expression that can be converted with VAL() function to a number. IOW, type(textbox.value)) evaluates textbox.value and tells you what the type of evaluation is. The textbox.value still a character. The "U" returned means that VFP cannot convert textbox.value to any known type.
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform