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

# TFieldDef.Create

Constructor for TFieldDef.

## Declaration

Source position: line 0

`public constructor TFieldDef.create(`
`ACollection: TCollection`
`); override; constructor TFieldDef.Create(`
`AOwner: TFieldDefs;`
`const AName: String;`
`ADataType: TFieldType;`
`ASize: Integer;`
`ARequired: Boolean;`
`AFieldNo: LongInt`
`); overload;`

## Arguments

`ACollection` |  | TFieldDefs instance to which to append the definition, or Nil

## Arguments

`AOwner` |  | Owner of the fielddef.
`AName` |  | Name of the field
`ADataType` |  | Data type of the field
`ASize` |  | Storage size for the field contents, or zero for fixed-size fields
`ARequired` |  | Is the fields required or not
`AFieldNo` |  | Number of the field

## Description

Create is the constructor for the TFieldDef class.

If a simple call is used, with a single argument ACollection, the inherited Create is called and the Field number is set to the incremented current index.

If the more complicated call is used, with multiple arguments, then after the inherited Create call, the Name, datatype, size, precision, FieldNo and the Required property are all set according to the passsed arguments.

## Errors

If a duplicate name is passed, then an exception will occur.

## See also

Name
datatype |  | Data type for the field
size |  | Size of the buffer needed to store the data of the field
precision |  | Precision used in BCD (Binary Coded Decimal) fields
FieldNo |  | Field number
Required |  | Is the field required ?

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