Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Scan Endscan
Message
From
24/06/2005 13:00:53
 
 
To
24/06/2005 12:50:56
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 8 SP1
Miscellaneous
Thread ID:
01026363
Message ID:
01026366
Views:
43
>Hi All. I have been reading some threads about SCAN - ENDSCAN. Due to old habits I have used DO WHILE but am interested in the speed improvements that SCAN ENDSCAN appear to offer.
>
>Any gotchas to watch out for when converting DO WHILE loops to SCAN ENDSCAN? I did read Dragan's comment about nested SCAN's on the *same* file. Are there any others?

Don't forget to take the SKIP command out.

FWIW, last time I tested (which was with VFP 7), on an unordered table, SCAN was about 1.5 times as fast as DO WHILE. For ordered tables, it's not quite as clear-cut; the differences seem to depend on the index order.

But overall, you can't go wrong using SCAN for looping through a table.

Tamar
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform