Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Check if a character expression is all digits
Message
De
05/09/2003 13:03:26
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00826497
Message ID:
00826507
Vues:
24
You can write your own UDF for that like this one:
FUNCTION DigitAll()
    LPARAMETERS tlcExpression

    LOCAL lnCounter, llDigit

    llDigit = .T.
    
    FOR lnCounter = 1 to LEN(tlcExpression)
        IF !ISDIGIT(SUBSTR(tlcExpression, lnCounter, 1))
             llDigit = .F.
        ENDIF
    ENDFOR

    RETURN llDigit
ENDFUNC
You can also add to this function a check for decimal point.



>I need to check if a whole character expression contains nothing but numeric digits. I thought the isdigit() function would do it but I found out that it just checks the leftmost character. Is there any function like isdigit() that checks the whole expression?
>
>Thank you
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform