Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How get the Number of Lines from a text file
Message
From
11/12/2000 20:49:57
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00451983
Message ID:
00451989
Views:
39
>>>>>>>>>>>>>>>>>>>>
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform