TStringList.AddStrings

From Soldat Community Wiki
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;

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.