Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Numeric or string ??
Message
De
09/02/2005 09:21:01
Jim Winter
Jim Winter Consulting
Hinesburg, Vermont, États-Unis
 
 
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:
00985125
Vues:
41
>Sorry, I forgot to mention that the input of my textbox is always character.
>So, when I put in 123 the value of my textbox is '123' and then I take the numeric value with the val() function. That's simple. Problem begains when the user puts in '123 piano'. As the val() function returns 123.00, the program thinks he's dealing with only digits, which is obviously not true. Is there an easy way (without having to check each character seperately)to detect that the input exists of digits and characters ??

Hans,

Maybe this will work for you.
IF LEN(CHRTRAN(This.Textbox.Value,' 0123456789','')) = 0
   lcType = 'N'
ELSE
   lcType = 'C'
ENDIF
HTH,
Jim
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform