Difference between revisions of "TStringList.Append"

From Soldat Community Wiki
Jump to: navigation, search
(new page)
(No difference)

Revision as of 16:54, 23 August 2013

procedure Append(S: string)
 S: string to be added

Description

This procedure does exactly the same thing as Add, it just doesn't return the index.

Example

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

var
  s: TStringList;
  i: integer;

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

  s.Append('c');
  WriteLn(s.CommaText);
  // a,b,c,d
  s.Free;
end.