<?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.OnChanging</id>
		<title>TStringList.OnChanging - 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.OnChanging"/>
		<link rel="alternate" type="text/html" href="https://wiki.soldat.pl/index.php?title=TStringList.OnChanging&amp;action=history"/>
		<updated>2026-05-03T09:56:20Z</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.OnChanging&amp;diff=1188&amp;oldid=prev</id>
		<title>Mighty: new page</title>
		<link rel="alternate" type="text/html" href="https://wiki.soldat.pl/index.php?title=TStringList.OnChanging&amp;diff=1188&amp;oldid=prev"/>
				<updated>2013-08-24T18:15:57Z</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; '''property OnChanging: [[TNotifyEvent]]'''&lt;br /&gt;
  Access mode: RW&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
{{link|TStringList|OnChanging}} can be assigned to respond to changes that will occurred in the list. The handler is called whenever strings will be added, moved, modified or deleted from the list.&lt;br /&gt;
&lt;br /&gt;
The {{link|TStringList|OnChanging}} event is triggered before the modification will take place. When the modification has happened, an {{link|TStringList|OnChange}} event occurs.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
Following example tracks changes made to the list.&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;
  Count1,Count2: integer;&lt;br /&gt;
&lt;br /&gt;
procedure Before(Sender: TObject);&lt;br /&gt;
begin&lt;br /&gt;
  Count1 := TStringList(Sender).Count;&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
procedure After(Sender: TObject);&lt;br /&gt;
begin&lt;br /&gt;
  Count2 := TStringList(Sender).Count;&lt;br /&gt;
  &lt;br /&gt;
  if Count2 &amp;gt; Count1 then&lt;br /&gt;
    WriteLn('String added')&lt;br /&gt;
  else if Count2 &amp;lt; Count1 then&lt;br /&gt;
    WriteLn('String removed')&lt;br /&gt;
  else&lt;br /&gt;
    WriteLn('Content modified or moved');&lt;br /&gt;
end;  &lt;br /&gt;
  &lt;br /&gt;
begin&lt;br /&gt;
  s := File.CreateStringList();&lt;br /&gt;
&lt;br /&gt;
  s.OnChanging := @Before;&lt;br /&gt;
  s.OnChange := @After;&lt;br /&gt;
  &lt;br /&gt;
  s.Add('a');   // String added&lt;br /&gt;
  s.Add('b');   // String added&lt;br /&gt;
  s.Delete(1);  // String removed&lt;br /&gt;
  s[0] := 'a2'; // String modified or moved&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>