Overview
TDataKind is an enumeration that specifies the data type of a TDataItem. Each TDataItem can store one specific type of data, and the Kind property determines which internal array (Int32Data, TextData, etc.) is used.
Enumeration Values
32-bit signed integer (-2,147,483,648 to 2,147,483,647)Used for standard integer values, counts, IDs, and other whole numbers.
64-bit signed integer (very large range)Used for large integer values that exceed Int32 range, such as large IDs or financial calculations in cents.
Single-precision floating-point (4 bytes, ~7 decimal digits precision)Used for floating-point values where precision is less critical.
Double-precision floating-point (8 bytes, ~15-16 decimal digits precision)The default float type for TeeBI, used for most decimal calculations.
Extended-precision floating-point (10 bytes on x86, same as Double on x64)Used for highest precision calculations on 32-bit platforms.
String/text dataUsed for text values, names, descriptions, and other string data.
Date and time valuesUsed for storing dates, times, or combined datetime values.
Boolean (True/False) valuesUsed for flags, yes/no questions, and other binary states.
Unknown or unspecified data typeDefault value when a TDataItem is created without specifying a kind. Should be set to a specific type before adding data.
Helper Methods
The TDataKindHelper record provides utility methods for working with TDataKind values:Returns True if the data kind represents a numeric type.Numeric types include: dkInt32, dkInt64, dkSingle, dkDouble, dkExtended
Converts the TDataKind value to a human-readable string.Returns a string representation of the data kind.
Usage Examples
Determining Data Type
Using IsNumeric
Dynamic Type Selection
Type-Safe Data Access
Converting Between Types
Performance Considerations
Numeric Types
Numeric Types
- Int32: Fastest for integer operations, use when values fit in the range
- Int64: Slightly slower than Int32, use only when needed for large values
- Double: Best balance of precision and speed for floating-point
- Single: Faster but less precise, use for large datasets where precision is less critical
- Extended: Use only when maximum precision is required on 32-bit platforms
Text Type
Text Type
- String comparisons and sorting are slower than numeric operations
- Consider using Text statistics sparingly on very large datasets
- Use IgnoreCase parameter carefully as it affects performance
DateTime Type
DateTime Type
- Stored internally as TDateTime (double)
- Good performance for comparisons and sorting
- Statistical operations work efficiently
Boolean Type
Boolean Type
- Most compact storage (1 byte per value)
- Very fast comparisons and sorting
- Ideal for flags and binary states
