Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Textmerge to file vs string concatenation
Message
From
23/07/2003 08:50:59
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
23/07/2003 07:49:25
Dorin Vasilescu
ALL Trans Romania
Arad, Romania
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00812707
Message ID:
00812733
Views:
7
>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
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform