>>What would be the difference in using DO WHILE vs SCAN WHILE...?
>>Is there a performance issue?
>>
>>Thanks in advance, M.
>My preference is for SCAN. In addition to what has been said, I think it is slightly cleaner especially if you have both a WHILE and FOR clause.
>
>One thing to be aware of, however. Nested SCANs do not work as expected because of the extra SKIP at the second ENDSCAN.
Here is workaround shown on Dragan's code .
scan
<...some code>
scan while &WhileCondition
<more code>
scan while &InnerWhileCondition
<more code>
endscan
skip -1
endscan
skip -1
endscan
Nested scans will work properly like this.
Also, additional FOR clauses in inner scans might 'mess up'
smooth, top to bottom flow in above scenario
Rgds++