TStringList.SetText

From Soldat Community Wiki
Revision as of 14:59, 24 August 2013 by Mighty (talk | contribs) (new page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
procedure SetText(Text: PChar)
 Text: contents to be parsed

Description

SetText parses the contents of Text and fills the stringlist based on the contents.
It regards Text as a series of strings, separated by end-of-line markers. Each of these strings is added to the stringlist.

Example

var
  s: TStringList;
  mypchar: PChar;

begin
  s := File.CreateStringList();
  mypchar := 'a' + #13 + #10 + 'b';
  
  s.SetText(mypchar);
  
  WriteLn(s.CommaText);
  // a,b
  
  s.Free;
end.