Hi Leo,
good idea. To get away from writing a file, you could use
TEXT TO <VAR> TEXTMERGE SHOW
ENDTEXT
Hank
>Hi Kurt,
>
>Tried the Foxpro Advisor StringBuilder tip, that costs about 34 seconds, a lot better than 440. But I still wanted more. It ended up in using the VFP low level file functions, which costs abaut 2,5 seconds.
>
>
>lnSec = Seconds()
>lcFile = "c:\test.xml"
>Fclose(Fcreate(lcFile))
>liFile = Fopen(lcFile, 2)
>Do While !.Eof
> Fwrite(liFile, .Fields(0).Value)
> .MoveNext()
>EndDo
>Fclose(liFile)
>lcXml = FileToStr(lcFile)
>Erase &lcFile
>?'String: ', Seconds() - lnSec
>
>(The disadvantage is that you have to write a file to a disk.)
>>This month's issue of Foxpro Advisor also has an article on speeding up strings with XML by writing large amounts of data out to a file instead of writing to a memory variable, however through my testing, the above method is still much faster.