>MyTable has 100 records. There are multiple records where "AAA" is the value in the Flag field. When the value of Flag is changed to "ZZZ" in the code the loop is terminated though there are more "AAA" records to be changed. I understand this as the record pointer is moving with the changed record within the order, but how can I program around it without doing "Replace For" against the table? Thanks!
>
>
>Use MyTable excl
>Index on Flag Tag Flag
>If Seek('AAA')
> Do While Flag = 'AAA' and !EOF()
> Replace Flag with 'ZZZ'
> Skip
> Enddo
>Endif
>
>
>Regards, Renoir
Maybe I don't understand what you are trying to do, but wouldn't
REPLACE ALL flag WITH IIF(flag ="AAA", "ZZZ", flag) IN myTable
work? Then you don't even need an index.
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro
"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison