Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help With scan...endscan (for / while)
Message
From
09/08/1999 12:51:31
 
 
To
09/08/1999 12:45:39
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00251485
Message ID:
00251583
Views:
7
>>>Can anyone refer me to an authoritative and thorough resource for the many uses for this command? I work with data conversions/translations and use this command daily, but still don't grasp the finer nuances. Any help would be greatly appreciated!
>>
>>All SCAN...ENDSCAN really does is a DO WHILE loop with an implicit SKIP on each iteration. FOR allows you to specify a filter condition with an implied scope of ALL that examines all records meeting the criteria of the FOR clause; WHILE allows you to specify a filter with an implied scope of REST that terminates as soon as a record that does not meet the criteria of the WHILE condition is encountered.
>>
>
>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
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform