[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] | Reference for unit 'Forms' (#lcl)

# TScreen.FindNonDesignerDataModule

Finds a data module with the specified name, excluding designer data modules.

## Declaration

Source position: forms.pp line 1226

`public function TScreen.FindNonDesignerDataModule(`
`const DataModuleName: string`
`):TDataModule;`

## Arguments

`DataModuleName` |  | Name of the data module to locate in the method.

## Function result

Data module with the specified name, or Nil.

## Description

Visits the data module instances in the internal list, and compares the Name property for the TDataModule instances to the value in DataModuleName. CompareText text is called to perform a case-insensitive comparison for the values. TDataModule instances with csDesigning in the ComponentState property are ignored; these are design-time data modules used by the Lazarus IDE.

The return value contains the TDataModule instance with the name in DataModuleName, or Nil when the data module list is empty or the name in DataModuleName is not found in the list.

Used when an Application loads its components using the LCL streaming mechanism. Ignores the designer forms and data modules (where ComponentState contains csDesigning) handled by the Lazarus IDE.

## See also

TScreen.FindDataModule |  | Finds the data module with the specified name.