Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need algorithm for cleaning check numbers
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00359011
Message ID:
00359025
Views:
13
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
Previous
Reply
Map
View

Click here to load this message in the networking platform