Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Numeric only...
Message
De
21/03/2001 10:07:36
 
 
À
21/03/2001 09:47:53
Chuck Tripi
University of Wisconsin - Milwaukee
Milwaukee, Wisconsin, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00487191
Message ID:
00487199
Vues:
12
>
IF EMPTY(m.id) OR ISNULL(m.id) OR NOT LEN(CHRTRAN(m.id," ",""))=8
>
>The above code works well. But, I need to also check to see if it's all numeric too (0-9), can not have any alpha. I tried the below code but won't work. The field person.id is character and so is m.id. How to do about this?
>
>
BETWEEN(m.id,VAL(CHR(48)),VAL(CHR(57)))
>
>I may not need this because I have "99999999" as for the InputMask of the form. It's just that there's some alpha in the TEST data, but once going LIVE, I don't think I will need this... agreed?
>
>Chuck

Hi Chuck,

Since you say that 'm.id' is a character string try:

nchr_cntr = LEN(ALLTRIM(m.id))

FOR ncntr = 1 TO nchr_cntr
lnumeric = ISDIGIT(SUBSTR(m.id, nchr_cntr, 1))
IF !lnumeric
MESSAGEBOX("Bad value!")
EXIT
RETURN
ENDIF
ENDFOR

HTH
Mike
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform