Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Testing for numeric char in a string
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00582918
Message ID:
00582929
Vues:
27
>FUNCTION NUMINSTR(STRING)
>
>FOR I = 1 To LEN(STRING)
> IF SUBSTR(STRING,I,1) $ "0123456789"
> RETURN .T.
> ENDIF
>NEXT

OR
FUNCTION NumInStr
LPARAMETERS tcString
* Perhaps speed things up a bit
tcString = ALLTRIM(tcString)
llRet = .F.
FOR lnCnt = 1 To LEN(tcString)
  IF ISDIGIT(SUBSTR(tcString,lnCnt,1))
    llRet = .T.
    EXIT
  ENDIF
ENDFOR
RETURN llRet
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform