Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Search/Replace component

Posted on 1998-04-11
3
Medium Priority
?
229 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 100 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

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

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

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 my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Integration Management Part 2
Screencast - Getting to Know the Pipeline
Suggested Courses

783 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