Solved

Search/Replace component

Posted on 1998-04-11
3
214 Views
Last Modified: 2010-04-06
Where can I get a search/replace component for either a tmemo or a tedit window. It should work with Delphi 1.0 and 3.0. Alternatively, where can I get a unit or source code that can do search and replace. Something along the lines of the search/replace function that came with TEditWindow of (Borland Pascal 7.0) Object Windows.
0
Comment
Question by:swright243
3 Comments
 
LVL 4

Expert Comment

by:itamar
ID: 1361413
   I think it's a good starting point. It's a descendant component from TRichEdit that have those     (and  others) functionalities. Give it a try, it's freeware:

   http://www.torry.webnorth.com/vcl/edits/ammemo1.zip

   If it helps, tell me so I can place this comment as an answer.
   IHTH,
   Itamar
0
 
LVL 3

Accepted Solution

by:
KE earned 50 total points
ID: 1361414
Make your own !!!

Use the TMemo.Text property which gives you a String representation of the memo contents.

Make a function does smth. like this:

repeat
b := POS(FINDTHISTEXT, MyMemo.Text)
if b<>-1 then MyMemo.text := Copy(MyMemo.Text,1,b)+ReplaceWithThisText+Copy(Mymemo.Text,b+1,Length(MyMemo.Text);
until b=-1;

I do not guarantee that the above code works, it's just an example.
0
 

Author Comment

by:swright243
ID: 1361415
A reasonable reply, but the Delphi help files have an even better answer. However both the help files and KE don't explain the most important thing about a search-how to "find next"

Itamar's comment on the other hand was exactly what I was looking for. I downloaded the component in his comment, popped it in and was done. I would give Itamar an A if I could figure out how.

For others reading this thread: contact ameeder@dds.nl for further information about this component.

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

863 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now