Rubbish! When you create a new TStrings or TStringList, the line count is 0 (no text at all). It is VCL or LCL that injects text into the Memo.Lines property at creation of the Memo component.
Hey keep the temper down.
Have you even tried, what you caim ?
I tried, they behave EXACTLY the same on adding text.
The only difference is, that you can't get rid of the last CRLF with trimright.
In TStringList the LineEnding seems to be hard-coded the "End-of-the-Line".
[..]
If you do the following on a newly created Memo (as shown above) and execute the following code...
procedure TMainForm.ButtonClicked(Sender: TObject);
begin
Memo1.Clear;
ShowMessage(IntToStr(Memo1.Lines.Count));
Memo1.Lines.Add('new line');
ShowMessage(IntToStr(Memo1.Lines.Count));
end;
The results would be 0 and then 1.
The results
are 0 and then
1.
But ...
Memo1.Lines.Text is 'new line'+LineEnding; !!
You see 2 lines, but you actually have only one, with LineEnding at the end.
By the way that stupid 'Memo1' as a start is not added by default of the wigetset, it is inserted because you didn't cleared Lines property in the Designer. YOU can put there whatever you like, even rubbish or nothing.