Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How get the Number of Lines from a text file
Message
De
11/12/2000 20:49:57
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00451983
Message ID:
00451989
Vues:
43
>>>>>>>>>>>>>>>>>>>>
>Beats me which one's faster. I'll leave that as an exercise for the reader. :-)
>>>>>>>>>>>>>>>>>>>>

Actually Arrays are faster here.
cd home()
clear
s1 = SECONDS()
FOR n = 1 to 100
   lsMyString = filetostr("foxpro.h")
   alines(laMyArray, lsMyString)
next
? alen(laMyArray)
? 'Array in ' + TRANSFORM(SECONDS()-s1)
?

s1 = SECONDS()
FOR n = 1 to 100
   create cursor Dummy (TxtFld C (250))
   append from foxpro.h SDF
NEXT
? Reccount()
? 'Cursor in ' + TRANSFORM(SECONDS()-s1)


Alex Feldstein, MCP, Microsoft MVP
VFP Tips: English - Spanish
Website - Blog - Photo Gallery


"Once again, we come to the Holiday Season, a deeply religious time that each of us observes, in his own way, by going to the mall of his choice." -- Dave Barry
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform