Recent

Author Topic: Is there a way to make TMemo start a new line with linefeeds only?  (Read 8816 times)

vfclists

  • Hero Member
  • *****
  • Posts: 1147
    • HowTos Considered Harmful?
Is there a way to make TMemo start a new line with linefeeds only?

When I get some info from a web server into a TMemo with linefeeds all the lines a strung together.

Does TMemo have a setting to cause the lines to break properly?
Lazarus 3.0/FPC 3.2.2

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: Is there a way to make TMemo start a new line with linefeeds only?
« Reply #1 on: April 16, 2010, 02:29:12 am »
TMemo, AFAIK, is a Windows control. I think you should handle your text before entering in a TMemo to add #13#10 properly.

eny

  • Hero Member
  • *****
  • Posts: 1646
Re: Is there a way to make TMemo start a new line with linefeeds only?
« Reply #2 on: April 16, 2010, 09:01:16 am »
Maybe you can use:
Code: [Select]
YourTMemo.Text := StringReplace(YourTextVar,#10,#13#10,[rfReplaceAll]);
All posts based on: Win10 (Win64); Lazarus 3_4  (x64) 25-05-2024 (unless specified otherwise...)

Bart

  • Hero Member
  • *****
  • Posts: 5568
    • Bart en Mariska's Webstek
Re: Is there a way to make TMemo start a new line with linefeeds only?
« Reply #3 on: April 16, 2010, 02:26:26 pm »
AdjustLineBreaks ?

vfclists

  • Hero Member
  • *****
  • Posts: 1147
    • HowTos Considered Harmful?
Re: Is there a way to make TMemo start a new line with linefeeds only?
« Reply #4 on: April 16, 2010, 08:07:10 pm »
Is that a runtime property? It is not showing in the object inspector.
Perhaps I you are a few versions ahead of me?

AdjustLineBreaks ?
Lazarus 3.0/FPC 3.2.2

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: Is there a way to make TMemo start a new line with linefeeds only?
« Reply #5 on: April 16, 2010, 09:20:19 pm »
Code: [Select]
AdjustLineBreaks(YourString);

mas steindorff

  • Hero Member
  • *****
  • Posts: 554
Re: Is there a way to make TMemo start a new line with linefeeds only?
« Reply #6 on: April 16, 2010, 09:41:38 pm »
Did you try setting the "TStrings.Delimiter" or "TStrings.DelimitedText" propertyto #10?
I have not tried this in lazarus yet so just wadering if it works

http://www.freepascal.org/docs-html/rtl/classes/tstrings.delimitedtext.html
windows 10 &11, Ubuntu 21+ IDE 3.4 general releases

 

TinyPortal © 2005-2018