>>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