Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Textmerge to file vs string concatenation
Message
De
23/07/2003 07:49:25
Dorin Vasilescu
ALL Trans Romania
Arad, Roumanie
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Textmerge to file vs string concatenation
Divers
Thread ID:
00812707
Message ID:
00812707
Vues:
45
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform