Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SCAN vs. FOR
Message
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00135531
Message ID:
00136087
Views:
29
>NEXTThe key here is that with SCAN, you don't have to SELECT the original work area each time through the loop. This is only an issue if you SELECT another work area inside the loop. Regardless of which you use, I find the difference to be minimal. I think SCAN is much more readable than FOR i=1 TO RECCOUNT(). Without a significant difference, I would use SCAN unless you have a huge loop where speed is vital.

That's my situation, it's a large loop run many times, taking hours to run - any savings I can get is useful...I generally much prefer SCAN myself, though, too...Also, I have to switch selected tables a few times in this loop, including a query - that may be why the SCAN appears less efficient here...
The Anonymous Bureaucrat,
and frankly, quite content not to be
a member of either major US political party.
Previous
Reply
Map
View

Click here to load this message in the networking platform