Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Textmerge to file vs string concatenation
Message
From
23/07/2003 08:59:15
Dorin Vasilescu
ALL Trans Romania
Arad, Romania
 
 
To
23/07/2003 08:50:59
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00812707
Message ID:
00812737
Views:
13
Thanks.

>>I've just run this code and I found that textmerge to file is 40 times faster than string concatenation using memory variable. It is true or I miss something?
>>
>>#define _loops 20000
>>CLEAR
>>? _loops, 'loops'
>>_t=SECONDS()
>>xx=''
>>FOR i=1 to _loops
>>	xx=xx+'123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'
>>NEXT
>>?'String concatenation:',SECONDS()-_t
>>
>>_t=SECONDS()
>>SET TEXTMERGE TO memvar xx NOSHOW
>>FOR i=1 to _loops
>>	\\123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
>>NEXT
>>SET TEXTMERGE TO
>>?'Textmerge to memvar:',SECONDS()-_t
>>
>>
>>_t=SECONDS()
>>SET TEXTMERGE TO xx.txt NOSHOW
>>FOR i=1 to _loops
>>	\\123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
>>NEXT
>>SET TEXTMERGE TO
>>xx=FILETOSTR('xx.txt')
>>?'Textmerge to file + FILETOSTR()',SECONDS()-_t
>>ERASE xx.txt
>>
>
>True.
>Cetin
Previous
Reply
Map
View

Click here to load this message in the networking platform