<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://wiki.soldat.pl/index.php?action=history&amp;feed=atom&amp;title=TStringList.Add</id>
		<title>TStringList.Add - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.soldat.pl/index.php?action=history&amp;feed=atom&amp;title=TStringList.Add"/>
		<link rel="alternate" type="text/html" href="https://wiki.soldat.pl/index.php?title=TStringList.Add&amp;action=history"/>
		<updated>2026-05-26T03:31:30Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>https://wiki.soldat.pl/index.php?title=TStringList.Add&amp;diff=1143&amp;oldid=prev</id>
		<title>Mighty: new page</title>
		<link rel="alternate" type="text/html" href="https://wiki.soldat.pl/index.php?title=TStringList.Add&amp;diff=1143&amp;oldid=prev"/>
				<updated>2013-08-23T15:38:31Z</updated>
		
		<summary type="html">&lt;p&gt;new page&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt; '''function Add(S: string): Integer'''&lt;br /&gt;
  S: string to be added&lt;br /&gt;
  Result: [[TStringList.Strings|&amp;lt;nowiki&amp;gt;Strings[]&amp;lt;/nowiki&amp;gt;]] index with newly added string&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
This function will add ''S'' to the list. Note that [[TStringList.Duplicates|Duplicates]] affects the function.&amp;lt;br&amp;gt;&lt;br /&gt;
If the list is sorted and the string ''S'' is already present in the list and [[TStringList.Duplicates|Duplicates]] is ''dupError'' then an error occurs. &amp;lt;br&amp;gt;&lt;br /&gt;
If [[TStringList.Duplicates|Duplicates]] is set to ''dupIgnore'' then the return value is underfined.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
If the list is sorted, new strings will not necessarily be added to the end of the list, rather they will be inserted at their alphabetical position.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;pascal&amp;quot;&amp;gt;&lt;br /&gt;
var&lt;br /&gt;
  s: TStringList;&lt;br /&gt;
&lt;br /&gt;
begin&lt;br /&gt;
  s := File.CreateStringList();&lt;br /&gt;
  s.Add('b');&lt;br /&gt;
  s.Add('a');&lt;br /&gt;
  s.Add('d');&lt;br /&gt;
  WriteLn(s.Text);&lt;br /&gt;
{&lt;br /&gt;
b&lt;br /&gt;
a&lt;br /&gt;
d&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
  s.Add('c');&lt;br /&gt;
  WriteLn(s.Text);&lt;br /&gt;
{&lt;br /&gt;
b&lt;br /&gt;
a&lt;br /&gt;
d&lt;br /&gt;
c&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
  &lt;br /&gt;
  s.Sort;&lt;br /&gt;
  s.Sorted := TRUE; &lt;br /&gt;
  // necessary if you want further values to be sorted as well&lt;br /&gt;
  s.Duplicates := dupIgnore;&lt;br /&gt;
  &lt;br /&gt;
  WriteLn(s.Text);&lt;br /&gt;
{&lt;br /&gt;
a&lt;br /&gt;
b&lt;br /&gt;
c&lt;br /&gt;
d&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
  &lt;br /&gt;
  &lt;br /&gt;
  s.Add('c'); // this will be ignored (s.Duplicates = dupIgnore)&lt;br /&gt;
  s.Add('aa');&lt;br /&gt;
  &lt;br /&gt;
  WriteLn(s.Text);&lt;br /&gt;
{&lt;br /&gt;
a&lt;br /&gt;
aa&lt;br /&gt;
b&lt;br /&gt;
c&lt;br /&gt;
d&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
  &lt;br /&gt;
  s.Free;&lt;br /&gt;
end.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:TStringList]]&lt;/div&gt;</summary>
		<author><name>Mighty</name></author>	</entry>

	</feed>