>The problem would be if REPLACE changes the fields in the current index. It may change position of the current record in the index so the next record would be not the one before REPLACE. It doesn't have anything to do with SCAN/ENDSCAN though and would have the same effect in DO WHILE or any other loop.
I know that this may cause problems, but I remember this happening to me without changing the indexed fields. I attributed it to Rushmore Optimization.
IIRC, it was years ago, in FoxPro 2.x.
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)