TStringList.AddStrings

From Soldat Community Wiki
Revision as of 17:55, 23 August 2013 by Mighty (talk | contribs) (new page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
procedure AddStrings(Strings: TStrings)
 Strings: strings to be added

Description

AddStrings adds the contents of Strings to the stringlist. Any associated objects are added as well.

Example

The below example will spawn a medkit on the players position whenever he types "Medic!"

var
  s,news: TStringList;
  i: integer;

begin
  s := File.CreateStringList();
  s.Append('a');
  s.Append('b');
  s.Append('d');
  s.Sort();
  s.Sorted := TRUE;

  news := File.CreateStringList();
  news.Append('ca');
  news.Append('cc');
  news.Append('cb');
  
  s.AddStrings(news);
  
  WriteLn(s.CommaText);
  // a,b,ca,cb,cc,d
  
  s.Free;
  news.Free;
end.