Alfredo Braunstein wrote:

>> The position of the global cursor is indicated by '|'. Internally, I
>> imagine that this cursor contains a (valid) PosIterator.
>> 
>> I wish to find "brown":
>> PosIterator pos = search_for(buffer, "brown");
>> 
>> I now wish to replace "brown" with "red". How do I do so to ensure
>> that the global cursor remains valid?
> 
> AndrÃ's solution is to modify only things under the global cursor. I.e,
> before the change put the global cursor in "pos", and then change "lazy"
> into "brown". The global cursor will remain valid, pointing to the "b" in
> brown.

Umph:

AndrÃ's solution is to modify only things under the global cursor. I.e,
before the change put the global cursor in "pos", and then change "brown"
into "red". The global cursor will remain valid, pointing to the "r" in
"red".


Alfredo


Reply via email to