mauroaraujo
mauroaraujo

Reputation: 342

How to enter memo strings between two lines without delete the content of the next line?

I just would like some help when adding contents between two lines... If I have this on Memo:

//--------------------------------------------------
//---------- Mauro Mascarenhas de Araújo -----------
//--------------------------------------------------

I would like add a line before the last line (on this case, because I need this function to do it in a bigger way than on this example), something like that:

//--------------------------------------------------
//---------- Mauro Mascarenhas de Araújo -----------
//------------ C++ Programer aprentice -------------
//--------------------------------------------------

I've tried to find some integrated function that could do that, but I haven't found. If you can help me with that, I would be very happy.

Are there any ready function or should I create two TStrings components, copy the memo content since the begining, untill the line '1' (on this case - so, the line I wanted), and use the other to copy the since the line '3' (on this case - so, the line after I wanted untill the end) Rewrite the memo with the first component add the lines I want, and after add the lines of the second component. - I know it is confusing, that's why I'm tryng to find a ready function.

Since now, THANKS A LOT.

Upvotes: 0

Views: 665

Answers (1)

mauroaraujo
mauroaraujo

Reputation: 342

I found a how to:

Form1->Memo1->Lines->Insert(int line, String StringIWant);

Thanks for everybody who at least though in answering me XD.

Upvotes: 0

Related Questions