Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Insert Text from RichEdit1 -to- RichEdit2 (At the Bottom (or) Top) of the file.

Posted on 2006-05-30
7
Medium Priority
?
305 Views
Last Modified: 2010-05-18
Hello All;

I am stripping out certain lines from RichEdit1 -to- RichEdit2.
I am then Editing the Line(s) in RichEdit2, then I need to copy the line(s) Back to the RichEdit1.
I either need to have the lines added to either the [Beginning] (or) [End] of the RichEdit
(Start from it's own line, not connecting onto another line)

I have searched around on Google, and the information that I have found is dated all the way back
To: 1999 - From Peter Below.
And he states that it cannot really be done.
So "Hopefully" someone has found a way to do this in the past 7yrs :)

Take Care All.
Carrzkiss (500 Points will be awarded for a Good Working Code, that must be "ROBUST" as the files
Are HUGE in Lines. Up to and beyond 5,000)
But will look at anything, since it is just adding lines, it may not make a big difference, as long
As it can read from Each control fast enough.
0
Comment
Question by:Wayne Barron
  • 3
  • 3
7 Comments
 
LVL 15

Accepted Solution

by:
mikelittlewood earned 2000 total points
ID: 16790077
Well unless Im mistaken just add the 2 bits of text together and insert a line break if you want them to be on their own paragraph.

Add text to end
RichEdit1.Text := RichEdit1.Text + #10#13 + RichEdit2.Text

Add text to beginning
RichEdit1.Text := RichEdit2.Text + #10#13 + RichEdit1.Text

Or am i missing something special you are trying to do?
0
 
LVL 31

Author Comment

by:Wayne Barron
ID: 16790148
I will give it a shot, and let you know here is a few.
Thanks Mike.

Wayne
0
 
LVL 10

Expert Comment

by:atul_parmar
ID: 16790161
Hi,

Use the following it will work with formatted text also.

RichEdit2.SelectAll;
RichEdit2.CopyToClipboard;
RichEdit1.SelStart := 0; // 0 = INSERT, LENGTH(RichEdit1.Text)-1 = APPEND
RichEdit1.SelLength := 0; // this will prevent from overwrite if something is selected
RichEdit1.PasteFromClipboard;

0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 15

Expert Comment

by:mikelittlewood
ID: 16790189
In fact you might not even need the #10#13 as it seems to stick in an extra break anyway.
0
 
LVL 31

Author Comment

by:Wayne Barron
ID: 16790229
Man, I need to slow down and take notice.
That was such a simple over-site it is unreal.

I was first trying:

RichEdit1.Text := RichEdit2.Text
Which would not work, never dawned on me to add in that little bit of # information.
(Of which I am just using the #10 by itself, as I need it simply added to the very bottom of the line.
The #10#13 will create a [WhiteSpace] between the Bottom Line, and the added Line(s).

Thank you once again Mike, and making me remember.
Though it was a simple one, I promised 500-Points.
And you shall receive 500-Points. (2000 in reality :) )

Take Care Mike;
Wayne
0
 
LVL 31

Author Comment

by:Wayne Barron
ID: 16790244
Sorry [atul_parmar], I had already started typing and Accepted Mike's information as [Answer]
Before I had a chance to read your information.
I used the code from Mike.
0
 
LVL 15

Expert Comment

by:mikelittlewood
ID: 16797230
Thanks, glad I could point you in the right direction.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
The Relationships Diagram is a good way to get an overall view of what a database is keeping track of. It is also where relationships are defined. A relationship specifies how two tables connect to each other. As you build tables in Microsoft Ac…

571 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