?
Solved

Find/Replace Dialogs

Posted on 2001-09-12
7
Medium Priority
?
208 Views
Last Modified: 2010-04-06
Can anyone help me by providing some code for implementing fully functional find and replace dialogs. By that I mean to use options for up down (especially when using find next), match case match word, replace one string at a time or replace all.

I have found some code that goes a long way towards it but does not implement the options fully, and I am having problems doing so. Not sure of copyright so wont post code here but this is url for code found http://www.elementkjournals.com/ddj/9803/ddj9831.htm

Cheers
Chris

ps please don't answer with code snippets and basics that I have allready ;)
0
Comment
Question by:xpher
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
7 Comments
 
LVL 6

Expert Comment

by:edey
ID: 6476743
perhaps you might want to mention, specificaly, which features you're missing yet?

GL
Mike
0
 
LVL 1

Author Comment

by:xpher
ID: 6478061
Hi

This is a quote from the article (url above):

'You can add some embellishments of your own to our example. In the Find dialog, selecting Up as the search direction resets the search to the beginning of the memo's text. Instead, the search could begin from the current cursor position and find the previous occurrence of the search string. Our replace logic assumes the user is going to replace every occurrence of the search string. Clicking our Replace dialog's Find Next button won't advance to the next occurrence unless the current one is replaced. Instead, replacing strings should be optional as the user searches the entire memo.'

Also the option of Match Whole Word only is not working ie if I set this option and search for tab it finds table and selects the letters tab. Find Next will not search up only down.

Hope this is clear.

Regards
Chris
0
 
LVL 4

Expert Comment

by:nestorua
ID: 6621685
HI, xpher,
I wrote some time ago FindDialog component for
as you said "full-functional finding".
To use it with TMemo or TRichedit you need only to link to them (in properties tab).
I can send it to you if you want, but print your E-Mail
address here.
If you'll like it new ReplaceDialog component can be written as well.
Sincerely,
Nestorua.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Author Comment

by:xpher
ID: 6623615
Hi Nestorua

Thanks I would like to take you up on the offer.
chrisfranks@btinternet.com

Regards
Chris
0
 
LVL 4

Accepted Solution

by:
nestorua earned 600 total points
ID: 6624182
Hi, Chris,
Send you my component TPSIFindDialog.
Place it in the Palette, put TMemo or TRichEdit on the form,
link the TPSIFindDialog with the Memo,
in the OnKeyDown event of the Memo
write the following: TheNameOfTPSIFindDialog.StandardKeyDown(Sender, Key, Shift).
That's all.
Now on the Ctrl+F you can open the FindDialog,
on F3 you can continue the searching.
If you see some errors or kind of wrong behavior,
inform me, please.
Sincerely,
Nestorua.
0
 
LVL 1

Author Comment

by:xpher
ID: 6632353
Hi Nestorua
Got the component (thanks) F3 (find next) does not seem to work. Also as a little aside the idea of minimizing the dialog is a little annoying as it is difficult to restore if want to search something else. But looking at your code is giving me a better understanding which I appreciate.
0
 
LVL 1

Author Comment

by:xpher
ID: 6647509
Hi Nestorua

Tried the new stuff you sent me. Can only get the Find Next to work if I put it in public declaration of your component.

I'm looking at the code to see what is going on and to try a replace aswell. Will be back 2 u as soon as.

Regards
Chris
0

Featured Post

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses
Course of the Month11 days, 19 hours left to enroll

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question