• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 211
  • Last Modified:

Simple Memo question

Hi,

I need a function to insert a text before and after the selected text in a memo.
Shouldn`t be very hard but I need it ASAP.

Thanks,
Cristian
0
crystyan
Asked:
crystyan
  • 5
  • 3
1 Solution
 
kretzschmarCommented:
before:

memo1.selText := 'YourStringBefore'+memo1.selText;

after:

memo1.selText := memo1.selText+'YourStringAfter';


meikl ;-)
0
 
crystyanAuthor Commented:
Could u tell me how could I add Break Lines in the selected text ?
0
 
kretzschmarCommented:
>Could u tell me how could I add Break Lines in the selected text ?

just insert #10 or #13#10 (=lf or crlf -> lf = Linefeed, cr=CarriageReturn)

like

memo1.selText := 'YourStringBefore'+#13#10+memo1.selText;

memo1.selText := memo1.selText+#13#10+'YourStringAfter';


meikl ;-)

0
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

 
crystyanAuthor Commented:
Thanks. I thought there was another way :-)
0
 
crystyanAuthor Commented:
Hi again,

And how could I place the cursor in the middle after I insert the text ? Let`s say I insert <a></a> and I want the cursor between the tags.

THANKS a lot !
Cristian
0
 
crystyanAuthor Commented:
Also if u can tell me how should I do when I press enter in the memo to replace add <br> before the new line ... if it`s not too much ...
0
 
kretzschmarCommented:
seems you build an html-editor :-))

well, all possible, but no time yet,
later i can give a possibilty, ok?

meikl ;-)
0
 
crystyanAuthor Commented:
Yeah :-)

I`ve placed another question so I can give u points. The title is 2 Simple Memo Questions :-)

Thanks !
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

  • 5
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now