@ASerge,
L.QuoteChar := #0;
Thank you for this, but what I want is 3 lines consistently.
I'm thinking over this issue becuase the line breaks within a single string of TStrings are broken when copied to another TStrings.
Stringlist1.Add('Hello, '#13#10'World'); // this gives stringlist1.count = 1.
StringList2.Text := StringList1.Text; // then StringList2.count = 2
And with commatext or delimitedtext, delimiter or quotechar themselves (and line breaks) may be included within a string.
If everything is done within program, then I can do anything. But my app has to receive "inputs" from ordinary users. They can use single quote, double quote, slash, backslash, comma, and whatever.
So my tentative conclusion is using control characters. Well, somebody might type Alt-31. But It's probability seems very low.
StringList1.LineBreak := #31;
StringList1.LineBreak := #31;
StringList2.Text := StringList1.Text; // this gives consistent results
Anyway thank you for all the comments. I had time to think over how splitting works. I should have been more specific. But the issue is not simply treating inputs from users of my app. With database structuer, I designed one to many relation DB structure, like
Master table :
id integer
Name string
Slave table
id integer
property_name string
property_value blob
property blob computed by (property_name || '=' || property_value)
Here the property_value itself is a blob type, which may contain all the white characters and quote characters.
And I want single record for one person, with property field containing all property_name=property_value pairs as a blob field.
The SQL looks like:
SELECT m.id, name, properties
FROM master m
LEFT JOIN
(SELECT id, list (property, ascii_char(31)) AS properties FROM slave
WHERE id=:id
GROUP BY id) s
ON m.id=s.id
WHERE id=:id
And then I can use TStrings to process the properties.
StringList1.LineBreak := #31;
StringList1.Text := SQLQuery1.FieldByName('properties').AsString;
age := StrToInt(StringList1.Values['age']);