Advmemo and Find/Replace

I am having difficulty figuring out how to get AdvMemoFindReplaceDialog to work in a manner similar to the replace dialog in Notepad. For example, run TMSAdvMemoDemo01 and open the replace dialog, enter 1 into the search field and 2 into the replace field. Click Replace. The result is a text not found message even though the memo has many instances of 1. The only way to do replaces is to alternately click find and replace. In contrast, Notepad would find the first instance of 1 on the first click of the Replace button. On the second click it would do the replace and highlight the next instance.


Is there a bug in the TMS replace dialog? If not, how can I achieve the more standard behavior of Notepad?

Thank you!

We traced & solved this issue. We can confirm the next update will fix this and will result in the default behavior to be the same as in Notepad.

Thank you!

The updated version works better but it still is not consistent with typical replace dialogs. After a replacement is made, the next instance of the search term should be highlighted. Instead, it is necessary to click replace again. To see this, fill a memo with "1". Enter 1 in the find field and 2 in the replace field. Click replace. "1" is correctly highlighted and a second click replaces it. At that point, standard behavior would be to additionally highlight the next "1". Instead, nothing is highlight and it is necessary to click Replace again to highlight the next instance of "1".

You're correct, this was not fully identical with how Notepad for example works.
We've now further improved it to make it 100% consistent with Notepad of other text editing tools.

This does not appear to be working properly in the current version. After the wrap occurs, it is still necessary to click replace an extra time. Also, please note that the find dialog (not just the replace dialog) has this problem.

I retested this here but could not see what you describe. Can you provide an exact / detailed sequence of what you do and what exactly is not correct?

Sorry I was not more clear. The issue is that after the finddialog hits the bottom of the file and displays the not found message and the user closes the not found dialog, the first instance of the search term (at the top of the file) should be highlighted. Instead, nothing is highlighted until you click Find Next an extra time. Compare the behavior of advmemo+advmemofinddialog+advfinddialog to the behavior of the find dialog in Notepad2 (for example). 

To see what I am referring to, please do the following:

1. Add Tadvmemo, Tadvmemofinddialog and TAdvFinddialog to a form.
2. Connect the Tadvmemofinddialog to Tadvmemo and tadvfinddialog to Tadvmemofinddialog.
3, Set Advfinddialog.Options.WrapAtEnd of file to true.
4. Add a button to invoke the finddialog.
5. Run the program.
6. Add: "111" to the memo.
7. Invoke the finddialog.
8. Search for: 1
9: Close the "Search is at end of file" dialog.
RESULT: Dialog remains open, nothing is highlighted. Find must be pressed again to highlight the "1" at the top of the file.
PREFERRED: Dialog remains open after message is displayed and first instance of "1" is highlighted. This is the way NotePad2 works and it seems more intuitive than the current behavior.

Thank you for your consideration of this request.

We have applied an improvement for this.

The recent update (8/17) in this terms of Find in both the find dialog and the find/replace dialog, but the replace button in the find/replace dialog still requires and extra button click after the end is reached. 

To see what I am referring to, please do the following:
1. Add Tadvmemo, Tadvmemofindreplacedialog and TAdvreplacedialog to a form.
2. Connect the Tadvmemofindreplacedialog to Tadvmemo and tadvreplacedialog to Tadvmemofindreplacedialog.
3, Set Advreplacedialog.Options.WrapAtEnd of file to true.
4. Add a button to invoke the findreplacedialog.
5. Run the program.
6. Add: "111" to the memo.
7. Invoke the findreplacedialog.
8. Use the replace button to repeatedly find: 1 and replace with: 2

RESULT: Dialog remains open, nothing is highlighted. Find must be pressed again to replace the "1" at the top of the file.
PREFERRED: Dialog remains open after message is displayed and first instance of "1" is replaced. 

We also improved this now. Next update will have the improvement.

The problem with replace not wrapping properly is still present in the 9/1 release.

I cannot reproduce this. Are you effectively compiling & linking with TAdvMemo v3.4.3.1?

Bruno,

You are correct. I am not sure why the new version wasn't compiling into my project but things are now working correctly.
Thank you