Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help With scan...endscan (for / while)
Message
From
09/08/1999 13:11:59
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00251485
Message ID:
00251598
Views:
8
>>There is one subtle difference between SCAN/ENDSCAN and DO WHILE. Don't move the record pointer of the table being scanned. It gives really unpredicatble results.
>
>I know - the implicit SKIP creates a whole wealth of potential problems, including the accidental double SKIP, and more, ranging from not being sure exactly where the record pointer is after a new iteration starts, to not knowing if the filter condition broke because of repositioning the recorrd pointer. And probably a few really bizarre ones that I haven't seen

And one more reason SCAN is better. If you change the current alias in the SCAN loop, you don't have to worry about changing it back at the end, because SCAN does resets it for you. In fact, from what I can tell, setting it back yourself slows the loop.
Erik Moore
Clientelligence
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform