>>Bruce ---
>>
>>>I'm a little surprised to find that FOR is faster than SCAN (in applicable situations) in some tests I did in vfp6. The old rule was the other way around, I believe...
>>
>>It was the other way around. Are you running VFP6 production version?
>
>No, I'm still on beta...but we had a thread a while back, as I recall, in which speed order was SCAN, FOR, WHILE (with WHILE a distant third). I'd just accepted this as a given until now, but at least in beta6 FOR wins cleanly...
Bruce,
The results are meaningless without seeing the test code.
SCAN
IF Condtion
Do something
ENDIF
ENDSCAN
will touch every record in the table, while;
REPLACE ... FOR Condition
with Rushmore will only touch the records that meet the condition.
SCAN FOR Condition
...
ENDSCAN
should be about the same as any other FOR.
WHILE is always faster than FOR because it processes a limited number of records and stops as soon as the condition is not met.