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

TField

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

Provide access to the contents of a single field in a record

Declaration

Source position: db.pas line 261

type TField = class(TComponent)

public

  constructor Create(); override;

  

Create a new TField instance

  destructor Destroy; override;

  

Destroy the TField instance

  procedure Assign(); override;

  

Copy properties from one TField instance to another

  procedure AssignValue();

  

Assign value of a variant record to the field.

  procedure Clear; virtual;

  

Clear the field contents.

  procedure FocusControl;

  

Set focus to the first control connected to this field.

  function GetData();

  

Get the data from this field

  class function IsBlob; virtual;

  

Is the field a BLOB field (untyped data of indeterminate size).

  function IsValidChar(); virtual;

  

Check whether a character is valid input for the field

  procedure RefreshLookupList;

  

Refresh the lookup list

  procedure SetData();

  

Save the field data

  procedure SetFieldType(); virtual;

  

Set the field data type

  procedure Validate();

  

Validate the data buffer

  AsBCD: TBCD;

  

Access the field's contents as a BCD (Binary coded Decimal)

  AsBoolean: Boolean;

  

Access the field's contents as a Boolean value.

  AsBytes: TBytes;

  AsCurrency: Currency;

  

Access the field's contents as a Currency value.

  AsDateTime: TDateTime;

  

Access the field's contents as a TDateTime value.

  AsFloat: Double;

  

Access the field's contents as a floating-point (Double) value.

  AsLongint: LongInt;

  

Access the field's contents as a 32-bit signed integer (longint) value.

  AsLargeInt: LargeInt;

  

Access the field's contents as a 64-bit signed integer (longint) value.

  AsInteger: Integer;

  

Access the field's contents as a 32-bit signed integer (longint) value.

  AsString: ;

  

Access the field's contents as an AnsiString value.

  AsWideString: WideString;

  

Access the field's contents as a WideString value.

  AsVariant: variant;

  

Access the field's contents as a Variant value.

  AttributeSet: ;

  

Not used: dictionary information

  Calculated: Boolean;

  

Is the field a calculated field ?

  CanModify: Boolean;

  

Can the field's contents be modified.

  CurValue: Variant;

  

Current value of the field

  DataSet: TDataSet;

  

Dataset this field belongs to

  DataSize: Integer;

  

Size of the field's data

  DataType: TFieldType;

  

The data type of the field.

  DisplayName: ;

  

User-readable fieldname

  DisplayText: ;

  

Formatted field value

  EditMask: TEditMask;

  

Specify an edit mask for an edit control

  EditMaskPtr: TEditMask;

  

Alias for EditMask

  FieldNo: LongInt;

  

Number of the field in the record

  IsIndexField: Boolean;

  

Is the field an indexed field ?

  IsNull: Boolean;

  

Is the field empty

  Lookup: Boolean;

  

Is the field a lookup field

  NewValue: Variant;

  

The new value of the field

  Offset: Word;

  

Offset of the field's value in the dataset buffer

  Size: Integer;

  

Logical size of the field

  Text: ;

  

Text representation of the field

  ValidChars: TFieldChars;

  

Characters that are valid input for the field's content

  Value: variant;

  

Value of the field as a variant value

  OldValue: variant;

  

Old value of the field

  LookupList: TLookupList;

  

List of lookup values

published

  Alignment: TAlignment;

  

Alignment for this field

  CustomConstraint: ;

  

Custom constraint for the field's value

  ConstraintErrorMessage: ;

  

Message to display if the CustomConstraint constraint is violated.

  DefaultExpression: ;

  

Default value for the field

  DisplayLabel: ;

  

Name of the field for display purposes

  DisplayWidth: LongInt;

  

Width of the field in characters

  FieldKind: TFieldKind;

  

The kind of field.

  FieldName: ;

  

Name of the field

  HasConstraints: Boolean;

  

Does the field have any constraints defined

  Index: LongInt;

  

Index of the field in the list of fields

  ImportedConstraint: ;

  

Constraint for the field value on the level of the underlying database

  KeyFields: ;

  

Key fields to use when looking up a field value.

  LookupCache: Boolean;

  

Should lookup values be cached

  LookupDataSet: TDataSet;

  

Dataset with lookup values

  LookupKeyFields: ;

  

Names of fields on which to perform a locate

  LookupResultField: ;

  

Name of field to use as lookup value

  Origin: ;

  

Original fieldname of the field.

  ProviderFlags: TProviderFlags;

  

Flags for provider or update support

  ReadOnly: Boolean;

  

Is the field read-only

  Required: Boolean;

  

Does the field require a value

  Visible: Boolean;

  

Should the field be shown in grids

  OnChange: TFieldNotifyEvent;

  

Event triggerd when the field's value has changed

  OnGetText: TFieldGetTextEvent;

  

Event to format the field's content

  OnSetText: TFieldSetTextEvent;

  

Event to set the field's content based on a user-formatted string

  OnValidate: TFieldNotifyEvent;

  

Event to validate the value of a field before it is written to the data buffer

end;

Inheritance

TField

  

Provide access to the contents of a single field in a record

|

TComponent,IUnknown,IInterfaceComponentReference

|

TPersistent,IFPObserved

|

TObject

Description

TField is an abstract class that defines access methods for a field in a record, controlled by a TDataset instance. It provides methods and properties to access the contents of the field in the current record. Reading one of the AsXXX properties of TField will access the field contents and return the contents as the desired type. Writing one of the AsXXX properties will write a value to the buffer represented by the TField instance.

TField is an abstract class, meaning that it should never be created directly. TDataset instances always create one of the descendent classes of TField, depending on the type of the underlying data.

See also

TDataset

  

Base class for records-based data-access

TFieldDef

  

Class to describe one field in a record in a dataset

TFields

  

Collection of #fcl.db.TField instances


Documentation generated on: Feb 02 2013