>>>I know, I can use SCAN, but I want to understand, what's wrong in this syntax. It's not obvious to me, why this command doesn't work, as I think, it should.
>>>
>>>I probably don't understand WHILE and FOR. If I do replace all while not m.plStop what does it exactly doing?
>>>
>>I would expect it to do replace until EOF is reached or m.plStop became .T.
>
>I would to, but it doesn't work this way. It's weird.
>
>Anyway, I think, your SCAN suggestion should be the way to go. It would require some code changes and, according to my tests, one replace command works faster than SCAN REPLACE ENDSCAN construction...
No surprise here. REPLACE FOR/WHEN keeps the file lock for the duration of the command.
--sb--