0
How can I put the text of a TMemo
separated by semicolons (;) as records in TClientDataSet
.
Example:
Code;Category;Phrase;Author
1;Motivational;Sentence 1;Author 1
2; Proverb; Sentence 2; Author 2
3;Dictation; Sentence 3;Unknown
What I find more complicated is to "cut out" the String at each semicolon(;) and read it later.
I believe the code will follow that logic:
for Linha := 0 to Memo1.Lines.Count-1 do
begin
CDS.Insert;
CDSCod.AsString := {Código}
CDSCategoria.AsString := {Categoria}
CDSFrase.AsString := {Frase}
CDSAutor.AsString := {Autor}
CDS.Post;
end;
Gave error here "There is no overloaded version of 'Split' that can be called with These Arguments"
– lukkicode
Helper version, modify to
Split([';'])
the one you have expects an array of char.– Junior Moreira
I had already tried to use
Split([';'])
but keeps making a mistake.– lukkicode
Can you give an example, this is too basic not to work.
– Junior Moreira
Now it worked here. Thank you very much.
– lukkicode