Don't forget thet VFP has SET MEMOWIDTH - Try something like this:
strtofile('', 'c:\temp\testline.txt')
for i = 1 to 1000
strtofile(repl('*', int(rand() * 80) + 40) + chr(13), 'c:\temp\testline.txt', .t.)
endfor
local ltStart, ltFileStart, ltFinish
ltStart = datetime()
lcWholeFile = filetostr('c:\temp\testline.txt')
local lnMemoWidth
lnMemoWidth = set('memowidth')
set memowidth to 80
ltFileStart = datetime()
_mline = 0
lnOutFile = fcreate('c:\temp\testlineout.txt')
for i = 1 to memlines(lcWholeFile)
fputs(lnOutFile, mline(lcWholeFile, 1, _mline))
endfor
fclose(lnOutFile)
set memowidth to lnMemowidth
ltFinish = datetime()
lcMessage = 'Start : ' + tran(ltStart) + chr(13) + 'File Start : ' + tran(ltFileStart) + ' - d1 : ' + tran(ltFileStart - ltStart) + chr(13) + ;
'Finish : ' + tran(ltFinish) + ' - d2 : ' + tran(ltFinish - ltFileStart) + ' - d3 : ' + tran(ltFinish - ltStart)
wait wind lcMessage
Cheers,
Andrew
>Using VFP6 SP4
>
>Are there any article on string manipulation in VFP6?
>
>I need to write a generic routine to parse any text file into 80 character lines and output these lines into a new text file, for sending up into a mainframe.
>
>I am currently grabbing the file with the STRTOFILE() into a memvar then I go through each character 1 character at a time to create this file. I also do some other testing but this is the idea.
>
>However, this technic seems slow, especially on a large text file.
>
>Any help would be great.
>
>Thanks,
>
>Jerryt
If we were to introduce Visual FoxBase+, would we be able to work from the dotNet Prompt?
From Top 22 Developer Responses to defects in Software
2. "It’s not a bug, it’s a feature."
1. "I thought I fixed that."
All my FoxTalk and other articles are available on my
web site.
Unless specifically identified otherwise, anthing posted here is purely my opinion and may or may not reflect the policies or practices of Microsoft.