Skip to content

TFieldDef.Create

Constructor for TFieldDef.

Declaration

Source position: db.pas line 197

public 
constructor Create(ACollection: TCollection);  override;

constructor Create(AOwner: TFieldDefs; const AName: string; 
                  ADataType: TFieldType; ASize: Integer; 
                  ARequired: Boolean; AFieldNo: LongInt; 
                  ACodePage: TSystemCodePage=CP_ACP);  overload; overload;

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, Required and CodePage property are all set according to the passed arguments.

Errors

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

See also

Name Description
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 ?
CodePage System code page for the values in string and wide string field types.