<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="https://frp.sage.fr/wiki1000/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="fr">
		<id>https://frp.sage.fr/wiki1000/index.php?action=history&amp;feed=atom&amp;title=DeleteObjects_%28objectlist%29</id>
		<title>DeleteObjects (objectlist) - Historique des versions</title>
		<link rel="self" type="application/atom+xml" href="https://frp.sage.fr/wiki1000/index.php?action=history&amp;feed=atom&amp;title=DeleteObjects_%28objectlist%29"/>
		<link rel="alternate" type="text/html" href="https://frp.sage.fr/wiki1000/index.php?title=DeleteObjects_(objectlist)&amp;action=history"/>
		<updated>2026-05-02T08:07:15Z</updated>
		<subtitle>Historique pour cette page sur le wiki</subtitle>
		<generator>MediaWiki 1.18.6</generator>

	<entry>
		<id>https://frp.sage.fr/wiki1000/index.php?title=DeleteObjects_(objectlist)&amp;diff=9962&amp;oldid=prev</id>
		<title>Syfre : Page créée avec « &lt;source lang='delphi'&gt;procedure DeleteObjects(iStopOnError:boolean);&lt;/source&gt;  Cette procédure supprime les objets de la liste.  {|class=&quot;wikitable&quot; |- |iStopOnError |Sto... »</title>
		<link rel="alternate" type="text/html" href="https://frp.sage.fr/wiki1000/index.php?title=DeleteObjects_(objectlist)&amp;diff=9962&amp;oldid=prev"/>
				<updated>2014-11-07T08:12:42Z</updated>
		
		<summary type="html">&lt;p&gt;Page créée avec « &amp;lt;source lang=&amp;#039;delphi&amp;#039;&amp;gt;procedure DeleteObjects(iStopOnError:boolean);&amp;lt;/source&amp;gt;  Cette procédure supprime les objets de la liste.  {|class=&amp;quot;wikitable&amp;quot; |- |iStopOnError |Sto... »&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Nouvelle page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;source lang='delphi'&amp;gt;procedure DeleteObjects(iStopOnError:boolean);&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cette procédure supprime les objets de la liste.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|iStopOnError&lt;br /&gt;
|Stoppe si une erreur se produit&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* Si une transaction est ouverte la suppression se fait dans la transaction courante&lt;br /&gt;
* Si aucune transaction n'est ouverte une transaction séparée est utilisé&lt;br /&gt;
&lt;br /&gt;
'''Pseudo code équivalent:'''&lt;br /&gt;
&amp;lt;source lang=&amp;quot;delphi&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
procedure doDeletes(iStopOnError:boolean);&lt;br /&gt;
var idx:Integer; aRef:TitObject;&lt;br /&gt;
begin&lt;br /&gt;
  //&lt;br /&gt;
  // Delete all the objects.&lt;br /&gt;
  //&lt;br /&gt;
  for idx:=Count-1 downto 0 do&lt;br /&gt;
    begin&lt;br /&gt;
      aRef := Refs[idx].Instance;&lt;br /&gt;
      if Assigned(aRef) then aRef._AddRef;&lt;br /&gt;
      Delete(idx);&lt;br /&gt;
      try&lt;br /&gt;
        if Assigned(aRef) then&lt;br /&gt;
          begin&lt;br /&gt;
            aRef.Deleted := TRUE;&lt;br /&gt;
          end;&lt;br /&gt;
      except&lt;br /&gt;
        if iStopOnError then&lt;br /&gt;
         begin&lt;br /&gt;
           Insert(idx,aRef);&lt;br /&gt;
           if Assigned(aRef) then aRef._Release;&lt;br /&gt;
           raise;&lt;br /&gt;
         end;&lt;br /&gt;
      end;&lt;br /&gt;
      if Assigned(aRef) then aRef._Garbage;&lt;br /&gt;
    end;&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
procedure DeleteObjects(iStopOnError:boolean);&lt;br /&gt;
begin&lt;br /&gt;
  if ClassManager.TranCount&amp;gt;0 then&lt;br /&gt;
   begin&lt;br /&gt;
     // instances are removed from the list&lt;br /&gt;
     doDeletes(iStopOnError);&lt;br /&gt;
   end&lt;br /&gt;
   else&lt;br /&gt;
   begin&lt;br /&gt;
     old := ClassManager.NewTransContext;&lt;br /&gt;
     try&lt;br /&gt;
       ClassManager.BeginTran;&lt;br /&gt;
       try&lt;br /&gt;
        doDeletes(iStopOnError);&lt;br /&gt;
        ClassManager.Commit([coNoConfirmDialog]);&lt;br /&gt;
       except&lt;br /&gt;
       Classmanager.RollBack;&lt;br /&gt;
       raise ;&lt;br /&gt;
       end;&lt;br /&gt;
     finally&lt;br /&gt;
     ClassManager.ActivateContext(old);&lt;br /&gt;
     end;&lt;br /&gt;
   end;&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Voir aussi:&lt;br /&gt;
&lt;br /&gt;
{{Footer|Listes d'objets (tech)}}&lt;br /&gt;
[[category:Listes d'objets]]&lt;/div&gt;</summary>
		<author><name>Syfre</name></author>	</entry>

	</feed>