I assume you did a SCAN FOR where the expression was optimizable, then SCAN should be optimizable.
It is still probably faster to do a SEEK to find the first record, then SCAN REST WHILE to read the rest of the records if they are in sequence. DO WHILE would do the same as SCAN WHILE but you have to remember to move the record pointer.
Mike
>Thinking that since it was Rushmore-optimizable, I used a SCAN loop to pre-process some data for a report (was too tricky to be done with SQL) and found that there were tremendous delays in processing a relative handful of records from a fairly large table (about 100,000 records). So, I ended up SEEKing followed by a DO WHILE loop, which worked great. > >Is SCAN something to avoid with large tables, or did I just miss something? (My FOR expression was definitely optimizable.)
Michael P. Antonovich, MCSD Email:mike@micmin.com MicMin Associates - Orlando, FL