Sign in Join
FPDoc Onlineexperiment

TField class

In unit DB

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

Declaration

pascal
TField = class(TComponent)

Inheritance

  1. TField
  2. TComponent
  3. TPersistent
  4. TObject

Descends from it: TBinaryField TBlobField TBooleanField TDateTimeField TNumericField TObjectField TStringField TVariantField

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

Properties

AsBCDpublicAccess the field's contents as a BCD (Binary coded Decimal).
AsBooleanpublicAccess the field's contents as a Boolean value.
AsBytespublicRetrieve the contents of the field as an array of bytes.
AsCurrencypublicAccess the field's contents as a Currency value.
AsDateTimepublicAccess the field's contents as a TDateTime value.
AsExtendedpublic
AsFloatpublicAccess the field's contents as a floating-point (Double) value.
AsLongintpublicAccess the field's contents as a 32-bit signed integer (longint) value.
AsLongWordpublicAccess field contents as 32-bit unsigned integer (longword/cardinal).
AsLargeIntpublicAccess the field's contents as a 64-bit signed integer (longint) value.
AsIntegerpublicAccess the field's contents as a 32-bit signed integer (longint) value.
AsSinglepublic
AsStringpublicAccess the field's contents as an AnsiString value.
AsAnsiStringpublicReturn field contents as an ANSI string.
AsUnicodeStringpublicField contents as a UnicodeString.
AsUTF8StringpublicField contents as a UTF8 String.
AsWideStringpublicAccess the field's contents as a WideString value.
AsVariantpublicAccess the field's contents as a Variant value.
AttributeSetpublicNot used: dictionary information.
CalculatedpublicIs the field a calculated field ?
CanModifypublicCan the field's contents be modified.
CurValuepublicCurrent value of the field.
DataSetpublicDataset this field belongs to.
DataSizepublicSize of the field's data.
DataTypepublicThe data type of the field.
DisplayNamepublicUser-readable fieldname.
DisplayTextpublicFormatted field value.
EditMaskpublicSpecify an edit mask for an edit control.
EditMaskPtrpublicAlias for EditMask.
FieldNopublicNumber of the field in the record.
IsIndexFieldpublicIs the field an indexed field ?
IsNullpublicIs the field empty.
NewValuepublicThe new value of the field.
OffsetpublicOffset of the field's value in the dataset buffer.
SizepublicLogical size of the field.
TextpublicText representation of the field.
ValidCharspublicCharacters that are valid input for the field's content.
ValuepublicValue of the field as a variant value.
OldValuepublicOld value of the field.
LookupListpublicList of lookup values.
FieldDefpublicFielddef associated with this field.
AlignmentpublishedAlignment for this field.
CustomConstraintpublishedCustom constraint for the field's value.
ConstraintErrorMessagepublishedMessage to display if the CustomConstraint constraint is violated.
DefaultExpressionpublishedDefault value for the field.
DisplayLabelpublishedName of the field for display purposes.
DisplayWidthpublishedWidth of the field in characters.
FieldKindpublishedThe kind of field.
FieldNamepublishedName of the field.
HasConstraintspublishedDoes the field have any constraints defined.
IndexpublishedIndex of the field in the list of fields.
ImportedConstraintpublishedConstraint for the field value on the level of the underlying database.
KeyFieldspublishedKey fields to use when looking up a field value.
LookupCachepublishedShould lookup values be cached.
LookupDataSetpublishedDataset with lookup values.
LookupKeyFieldspublishedNames of fields on which to perform a locate.
LookupResultFieldpublishedName of field to use as lookup value.
LookuppublishedIs the field a lookup field.
OriginpublishedOriginal fieldname of the field.
ParentFieldpublished
ProviderFlagspublishedFlags for provider or update support.
ReadOnlypublishedIs the field read-only.
RequiredpublishedDoes the field require a value.
VisiblepublishedShould the field be shown in grids.

Methods

AccessErrorprotected
CheckInactiveprotected
CheckTypeSizeprotected
Changeprotected
Bindprotected
DataChangedprotected
FreeBuffersprotected
GetAsBCDprotected
GetAsBooleanprotected
GetAsBytesprotected
GetAsCurrencyprotected
GetAsDateTimeprotected
GetAsExtendedprotected
GetAsFloatprotected
GetAsLargeIntprotected
GetAsLongintprotected
GetAsLongWordprotected
GetAsIntegerprotected
GetAsVariantprotected
GetOldValueprotected
GetAsSingleprotected
GetAsStringprotected
GetAsAnsiStringprotected
GetAsUnicodeStringprotected
GetAsUTF8Stringprotected
GetAsWideStringprotected
GetCanModifyprotected
GetClassDescprotected
GetDataSizeprotected
GetDefaultWidthprotected
GetDisplayNameprotected
GetCurValueprotected
GetNewValueprotected
GetIsNullprotected
GetParentComponentprotectedReturns the parent component.
GetTextprotected
HasParentprotectedDoes the component have a parent ?
NotificationprotectedCalled by components that are freed and which received a FreeNotification.
PropertyChangedprotected
ReadStateprotectedRead the component's state from a stream.
SetAsBCDprotected
SetAsBooleanprotected
SetAsBytesprotected
SetAsCurrencyprotected
SetAsDateTimeprotected
SetAsExtendedprotected
SetAsFloatprotected
SetAsLargeIntprotected
SetAsLongintprotected
SetAsLongWordprotected
SetAsIntegerprotected
SetAsVariantprotected
SetAsSingleprotected
SetAsStringprotected
SetAsAnsiStringprotected
SetAsUnicodeStringprotected
SetAsUTF8Stringprotected
SetAsWideStringprotected
SetDatasetprotected
SetDataTypeprotected
SetNewValueprotected
SetSizeprotected
SetParentComponentprotectedSet the parent component.
SetParentFieldprotected
SetTextprotected
SetVarValueprotected
CreatepublicCreate a new TField instance.
DestroypublicDestroy the TField instance.
AssignpublicCopy properties from one TField instance to another.
AssignValuepublicAssign value of a variant record to the field.
ClearpublicClear the field contents.
FocusControlpublicSet focus to the first control connected to this field.
GetDatapublicGet the data from this field.
IsBlobpublicIs the field a BLOB field (untyped data of indeterminate size).
IsValidCharpublicCheck whether a character is valid input for the field.
RefreshLookupListpublicRefresh the lookup list.
SetDatapublicSave the field data.
SetFieldTypepublicSet the field data type.
ValidatepublicValidate the data buffer.

Events

OnChangepublishedEvent triggered when the field's value has changed.
OnGetTextpublishedEvent to format the field's content.
OnSetTextpublishedEvent to set the field's content based on a user-formatted string.
OnValidatepublishedEvent to validate the value of a field before it is written to the data buffer.

Inherited

From TComponent (69)

_AddRef _Release BeforeDestruction CanObserve ChangeName ComObject ComponentCount ComponentIndex Components ComponentState ComponentStyle DefineProperties DesignInfo DestroyComponents Destroying ExecuteAction FindComponent FreeNotification FreeOnRelease GetChildOwner GetChildParent GetChildren GetDeltaStreams GetEnumerator GetIDsOfNames GetNamePath GetObservers GetOwner GetTypeInfo GetTypeInfoCount iicrGetComponent InsertComponent Invoke IsImplementorOf Loaded Loading Name ObserverAdded Observers OnGetDeltaStreams Owner PaletteCreated QueryInterface ReadDeltaState ReadDeltaStream ReferenceInterface RemoveComponent RemoveFreeNotification RemoveFreeNotifications SafeCallException SetAncestor SetChildOrder SetDesigning SetDesignInstance SetInline SetName SetSubComponent Tag ToString TToStringNameMode UpdateAction Updated UpdateRegistry Updating ValidateContainer ValidateInsert ValidateRename VCLComObject WriteState

From TPersistent (4)

AssignTo FPOAttachObserver FPODetachObserver FPONotifyObservers

From TObject (37)

AfterConstruction CheckDisposed ClassInfo ClassName ClassNameIs ClassParent ClassType CleanupInstance DefaultHandler DefaultHandlerStr Dispatch DispatchStr Disposed DisposeOf Equals FieldAddress Free FreeInstance GetDisposed GetHashCode GetInterface GetInterfaceByStr GetInterfaceEntry GetInterfaceEntryByStr GetInterfaceTable GetInterfaceWeak GetLastCastErrorInfo InheritsFrom InitInstance InstanceSize MethodAddress MethodName newinstance QualifiedClassName StringMessageTable SystemHasExtendedRTTI UnitName

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.