[Overview][Constants][Types][Classes][Procedures and functions][Index] | Reference for unit 'db' (#fcl)

# Tfields

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Collection of #fcl.db.TField instances

## Declaration

Source position: db.pas line 1012

`type Tfields = class(TObject)`
`protected`
`procedure Changed;`
`procedure CheckfieldKind();`
`function GetCount;`
`function GetField();`
`procedure SetField();`
`procedure SetFieldIndex();`
`property OnChange: TNotifyEvent; [rw]`
`property ValidFieldKinds: TFieldKinds; [r]`
`public`
`constructor Create();` |  | Create a new instance of TFields
`destructor Destroy; override;` |  | Free the TFields instance
`procedure Add();` |  | Add a new field to the list
`procedure CheckFieldName();` |  | Check field name for duplicate entries
`procedure CheckFieldNames();` |  | Check a list of field names for duplicate entries
`procedure Clear;` |  | Clear the list of fields
`function FindField();` |  | Find a field based on its name
`function FieldByName();` |  | Find a field based on its name
`function FieldByNumber();` |  | Search field based on its fieldnumber
`function GetEnumerator;`
`procedure GetFieldNames();` |  | Get the list of fieldnames
`function IndexOf();` |  | Return the index of a field instance
`procedure Remove();` |  | Remove an instance from the list
`property Count: Integer; [r]` |  | Number of fields in the list
`property Dataset: TDataSet; [r]` |  | Dataset the fields belong to
`property Fields: TField; default; [rw]` |  | Indexed access to the fields in the list
`end;`

## Inheritance

`Tfields` |  | Collection of #fcl.db.TField instances
`TObject`

## Description

TFields mimics a TCollection class for the Fields property of TDataset instance. Since TField is a descendent of TComponent, it cannot be an item of a collection, and must be managed by another class.

## See also

TField |  | Provide access to the contents of a single field in a record
TDataset |  | Base class for records-based data-access
TDataset.Fields |  | Indexed access to the fields of the dataset.

The latest version of this document can be found at lazarus-ccr.sourceforge.net .