Difference between revisions of "TStringList.Append"

From Soldat Community Wiki
Jump to: navigation, search
(new page)
 
(Example)
 
Line 6: Line 6:
  
 
==Example==
 
==Example==
The below example will spawn a medkit on the players position whenever he types "Medic!"
 
  
 
<syntaxhighlight lang="pascal">
 
<syntaxhighlight lang="pascal">

Latest revision as of 21:20, 13 November 2017

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

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.