>Hi Todd,
>
>>You may need to check more carefully to see if there is text between numbers and pull the numbers out seperately. Then again, you may not, and I may be wasting bandwidth :-)
>
>You are right. And as Ed said I'd simply modify the line. But instead of blanks I'd use CHR(13). Then I can use MLINE(), or in VFP 6 ALINES(), to loop through all numbers, skipping over empty lines. And just in case it might contain decimal numbers, I'd add "." and "-" to the set of characters that are not replaced.
>
I agree that including '-' and '.' are goo ideas, as long as numbers are well-formed. in the US, a ZIP+4 would cause confusing results, since the format is 99999-9999, but that's a decision the user has to make...
With whitespace in place, you can use the FoxTools WORD functions to strip out the results, or do something like the following once the whitespce is in place:
LOCAL aNums[1], nNumFound, cString, nPos
nNumFound = 0
cString = ALLTRIM(SourceLine)
DO WHILE ! EMPTY(cString)
nNumFound = nNumFound + 1
DIMENSION aNums[nNumFound]
aNums[nNumFound] = VAL(cString)
nPos = AT(' ',cString)
IF nPos > 0
cString = ALLTRIM(SUBST(cString,nPos))
ELSE
cString = ''
ENDIF
ENDDO
Ed