>>Test string manipulation of 5 verses 6. VFP 6 is supposed to be hundreds of times faster. I also learned something from George Goley's session at TechEd, relative to string manipulation. Instead of scanning through a table and doing
>>lcstring=lcstring+thisfield, let Fox do it's thing with copy to .... It is so much faster, it's off the scale.
>
>John, am I missing something? How can 'Copy to' be used to produce the same effect as lcString = lcstring+thisfield does inside a SCAN?
>
>TIA
>Barbara
copy field one_word to whatever sdf
x=chrtran(filetostr("whatever.txt"), chr(13)+chr(10)," ")
* still, strtran() won't remove _all_ the double spaces in one pass
do while at(" ",x)>0
x=strtran(x," ", " ")
enddo
or something like that. Though it wouldn't do any trimming by itself, but anothre strtran() could handle that. So we have only one or two string operations versus one per record, and one stupid file to remember to discard later. Mmmmm... I'll have to try this right on.
Ok, so I did, and slightly corrected the code (the corrected is what you see). Speed measurements, however, disapprove - it's slower than the classical SCAN method by about 30%.