On 22/07/2019 20:18, Gabor Boros via lazarus wrote:
Hi All,


procedure TForm1.Button1Click(Sender: TObject);
var
  SE:TSynEdit;

begin
  SE:=TSynEdit.Create(Self);
  SE.Text:='abc';
  ShowMessage('*'+SE.Text+'*');


For me the above code show the next message:

*abc
*

Any idea why a new line added? With TMemo the result: *abc*

I use fixes_2_0 with FPC fixes_3_2 on Windows 64bit.

SynEdit stores the text as one string per line. And it does not currently store the line-endings. When you retrieve the entire text as one string, each line is ended by a line-ending.

So if you have one line in there, then that line gets a line ending when you read it back.
--
_______________________________________________
lazarus mailing list
[email protected]
https://lists.lazarus-ide.org/listinfo/lazarus

Reply via email to