I am using TStringList and SaveToFile. How can I tell to go a new line when string is finished?
In general all strings contained in TStringList are saved in one line only. How can I tell the list to put a carriage return when finish string and need to put other string in a new line?
String is format as:
'my text....' + #10#13
If you’re writing the strings like you’ve shown above with
'my text....' + #10#13 + 'other text...', your problem is that you have your line ending characters reversed. On Windows, they should be#13#10(or simply use thesLineBreakconstant).Here’s a quick app (Delphi XE2) that demonstrates that the bad order of the pair will cause the problem, and a way to fix it:
The first, when opened in Notepad, produces:
The second: