TStringList.BeginUpdate

From Soldat Community Wiki
Revision as of 11:34, 24 August 2013 by Mighty (talk | contribs) (new page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
procedure BeginUpdate()

Description

BeginUpdate increases the update count by one. It is advisable to call BeginUpdate before lengthy operations on the stringlist. At the end of these operation, EndUpdate should be called to mark the end of the operation. This information might be used to perform optmizations. e.g. updating the screen only once after many strings were added to the list.

Always put the corresponding call to EndUpdate in the context of a Finally block, to ensure that the update count is always descreased at the end of the operation, even if an exception occurred.

Example

...

With MyStrings do
    try
      BeginUpdate;
      // Some lengthy operation.
    Finally
      EndUpdate
    end;

...