Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Need algorithm for cleaning check numbers
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00359011
Message ID:
00359025
Vues:
14
Alex--

When I've faced similar situations in the past, I've done something like this...

IF NOT IsDgtStr(cVal2Check)
*--something's not kosher with this number
ENDIF

***********************************************************************
* Title....: IsDgtStr.Prg
* Description: Evaluate a string to see if it has any embedded characters that * are not digits.
PROCEDURE IsDgtStr
***********************************************************************
LPARAMETER tcStr
LOCAL tnLen, tlReturn, ni
tcStr = ALLTRIM(tcStr)
tnLen = LEN(tcStr)
tlReturn = .T.
FOR ni = 1 to LEN(ALLTRIM(tcStr))
tcChar = SUBSTR(tcStr,ni)
IF NOT ISDIGIT(tcChar)
tlReturn = .F.
EXIT
ENDIF
ENDFOR
RETURN tlReturn
*: eof

--Greg
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform