>>>>>Does a scan endscan loop exit at the bottom of the loop or at the top?
>>>>
>>>>It goes from top to bottom.
>>>
>>>Yes, that's right. But, a do while loop loops and at the end it exits the loop at the top. I believe that a for next loop runs and exits at the bottom.
>>
>>I don't see why it's important. One should not write code based on these assumptions. Either you exit loop specifically (by Exit) or you don't care.
>
>It can matter. For instance the code between a do while and enddo will not be calculated on the final pass because that pass does not occur. That can be useful from time to time.
>
>Thank you all
SCAN will process every record for the condition. The last record in the table, or the last record in the FOR or WHILE condition if there is one, will be processed by SCAN, then it is over.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)