If you don't include a scope at all .. the default will be ALL .. otherwise it follows the scope identified in the command. Because you have the REST clause included .. it will only scan starting at the current position.
As for using FOR vs WHILE .. If you use FOR, it will scan until the end of the file. If you use WHILE, it will scan until the condition is no longer valid. Because you are using an index, and have SEEKed to the starting value, WHILE would probably be much faster in this case
SEEK avalue
SCAN REST WHILE thistable.fieldvalue = avalue
Cathy
>In looking at code at my new job, I came across the following construct.....
>
>SEEK avalue
>SCAN REST FOR thistable.fieldvalue = avalue
>
>dahdahdah....
>
>ENDSCAN
>
>Question....
>
>Will the SCAN begin where the REST starts... or will it start over at the beginning of the table because of the FOR?? (A speed concern here.....)....
>
>Thanks
>
>Tommy