Skip to main content

DataType

property DataType: TFieldType read;

Example

function IsTextField(const Data: TvxClientDataSet; const Name: string): Boolean;
var
Kind: TFieldType;
begin
Kind := Data.FieldByName(Name).DataType;
Result := Kind in [ftString, ftWideString, ftMemo, ftWideMemo];
end;

Usage

DataType identifies the field's Velox TFieldType category for selecting safe value, conversion and serialisation logic.

  • Branch on explicit sets of supported types and include an error/default branch for future or provider-specific values.
  • Combine this property with Size, DataSize, Required and external schema knowledge where needed.
  • Do not persist raw ordinal integers across Velox versions; use the named enumeration values in scripts.

Additional Technical Info

DataType is the read-only TFieldType assigned by the concrete field class and dataset field metadata.

Source-backed behaviour

The runtime helper returns the native TField.DataType without transformation. Constructors and field-definition binding set it internally; scripts cannot assign it through this property. The registered TFieldType enumeration includes ordinary string, numeric, date/time, blob, object, variant and newer Delphi categories through ftSingle.

The value is the primary discriminator for which typed As... conversions and serialization rules are safe, but it does not contain string encoding, numeric precision/scale, nullability, display format or database-provider type details. A concrete class may support extra conversions beyond its nominal type, and the Velox TvxField overlay groups several types for convenience without changing this native value.

Official RTL references

Created 2026-07-15