General information
Category:
Coding, syntax & commands
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only