Sign in Join
FPDoc Onlineexperiment

TLCLCollection.BeginUpdate procedure

Member of TLCLCollectionpublicIn unit LCLClasses

Declaration

pascal
procedure BeginUpdate; override

Description

Not described here; this is what TCollection.BeginUpdate says of it:

Start an update batch.

BeginUpdate is called at the beginning of a batch update. It raises the update count with 1.

Call BeginUpdate at the beginning of a series of operations that will change the state of the collection. This will avoid the call to Update for each operation. At the end of the operations, a corresponding call to EndUpdate must be made. It is best to do this in the context of a Try ... finally block:

With MyCollection Do
    try
      BeginUpdate;
      // Some Lengthy operations
    finally
      EndUpdate;
    end;

This insures that the number of calls to BeginUpdate always matches the number of calls to EndUpdate, even in case of an exception.

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.