Search code examples
stringdelphivariableslazarusmemo

Newline Inside a String To Be Shown At a TMemoBox


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?


Solution

  • 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;