Newline Inside a String To Be Shown At a TMemoBox

Nathan Campos picture Nathan Campos · Dec 22, 2010 · Viewed 24.4k times · Source

I'm building a String called FullMemo, that would be displayed at a TMemoBox, but the problem is that I'm trying to make newlines like this:

FullMemo := txtFistMemo.Text + '\n' + txtDetails.Text

What I got is the content of txtFirstMemo the character \n, not a newline, and the content of txtDetails. What I should do to make the newline work?

Answer

user532231 picture user532231 · Dec 22, 2010

The solution is to use #13#10 or better as Sertac suggested sLineBreak.

FullMemo := txtFistMemo.Text + #13#10 + txtDetails.Text;
FullMemo := txtFistMemo.Text + sLineBreak + txtDetails.Text;