Sign in Join
FPDoc Onlineexperiment

TScreen.DataModules property

Member of TScreenpublicIn unit Forms

Provides thread-safe indexed access to data modules on the screen.

Declaration

pascal
property DataModules[Index: Integer]: TDataModule read GetDataModules;

Description

DataModules is a read-only indexed TDataModule property which provides thread-safe access to a data module by its ordinal position in the list. Data modules are a non-visual component at run-time, and are provided to maintain compatibility with the Delphi VCL equivalent.

TScreen maintains an internal TThreadList instance used to access and maintain the TDataModule instances on the screen. Duplicate data modules are not allowed in the list; an exception is raised when adding a specific TDataModule instance if it is already stored in the list. Read and write access to the list are protected using the LockList and UnlockList methods in the list. This provides thread safety needed for Web server or other threaded applications.

Index contains the ordinal position in the list for the property value, and must be in the range 0..DataModuleCount-1. An EListError exception is raised if Index has an invalid position for the list.

Use DataModuleCount to get the number of data module instances in the property.

Modified in LCL version 4.4 to provide thread-safe access to data module instances the list of data modules.

See also

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