Skip to content

TBCDField

Field class for Binary Coded Decimal (BCD) values.

Declaration

Source position: db.pas line 986

type

  TBCDField = class(TNumericField)
  public
    constructor Create;
    function CheckRange : Boolean;
    property Value: Currency; {rw}
  published
    property Precision: LongInt; {rw}
    property Currency: Boolean; {rw}
    property MaxValue: Currency; {rw}
    property MinValue: Currency; {rw}
    property Size; {d}
  end;

Description

TBCDField is the class used when a dataset must manage data of Binary Coded Decimal type. (TField.DataType equals ftBCD). It initializes some of the properties of the TField class, and overrides some of its methods to be able to work with BCD fields.

TBCDField assumes that the field's contents can be stored in a currency type, i.e. the maximum number of decimals after the decimal separator that can be stored in a TBCDField is 4. Fields that need to store a larger amount of decimals should be represented by a TFMTBCDField instance.

It should never be necessary to create an instance of TBCDField manually, a field of this class will be instantiated automatically for each BCD field when a dataset is opened.

Properties

Member Visibility Description
Currency published Does the field represent a currency amount.
MaxValue published Maximum value for the field.
MinValue published Minimum value for the field.
Precision published Precision of the BCD field.
Size read only published Number of decimals after the decimal separator.
Value public Value of the field contents as a Currency type.
See all Properties

Methods

Member Visibility Description
CheckRange public Check whether a values falls within the allowed range.
Create public Create a new instance of a TBCDField class.
See all Methods

See also

Name Description
TDataset Base class for records-based data-access.
TField Provide access to the contents of a single field in a record.
TFMTBCDField Fixed precision floating point data field.