OK, this is weird. I had a friend test my new app on his Windows machine, and this is what he discovered: When loading the contents of a TMemo into a stringlist, word wraps will become newlines, and sometimes extra text will be added. I have 'WordWrap' set to true in the properties of the TMemo, but it still does it.
Try this test:
Put a TMemo and a Button on a form. Set the TMemo Width to 150.
For Button1 'OnClick" put in this code:
procedure TForm1.Button1Click(Sender: TObject);
var
MemoTxt: TStringList;
i: integer;
begin
MemoTxt:= TStringList.Create;
Try
for i:= 0 to Memo1.Lines.Count do
MemoTxt.Add(Memo1.Lines[i]);
MemoTxt.SaveToFile('C:\Temp\test.txt');
finally
MemoTxt.Free;
end;
end; Then type in some nonsensical line that wraps around the window a couple times, and open the text file in C:\Temp. Just for this test, I typed in "Momma told me there'd be days like this, but I never believed her, so here I am today"
What I got when I opened C:\Temp\test.txt:
Momma told me there'd be
days like this, but I never
believed her, so here I am
today.
●oday.
I don't know what the deal is with the last repeating line with a unicode "Black Circle" replacing the first character, different phrases sometimes came up with no extra lines, some came up with other characters, all in the first position like that.
My point is that this breaks my program for Windows; in Linux it works just fine. Does anybody have any suggestions, workarounds, or am I just doing this wrong?
Thanks.