Overview
TeeBI uses theTDataKind enumeration to define the data type of each TDataItem. This type system is optimized for performance and memory efficiency, with each kind mapping to a specific Pascal array type.
TDataKind Enumeration
The complete list of supported data types:Numeric Types
Integer Types
dkInt32: Counters, IDs, ages, quantities (range: -2,147,483,648 to 2,147,483,647)dkInt64: Large numbers, timestamps, financial cents (range: -9.2 quintillion to 9.2 quintillion)
Floating Point Types
dkSingle: 4 bytes, ~7 decimal digits precision, measurements, temperaturesdkDouble: 8 bytes, ~15 decimal digits precision, prices, scientific calculations (most common)dkExtended: 10 bytes (x86) or 8 bytes (x64), maximum precision when needed
On x64 platforms,
dkExtended is mapped to dkDouble due to CPU architecture limitations.Text Type
ThedkText type stores string data:
- Full Unicode support
- Variable length strings
- No fixed size limits
- Case-sensitive and case-insensitive operations available
DateTime Type
ThedkDateTime type uses Delphi’s TDateTime format:
- Stores both date and time
- Floating-point representation (integer part = days, fractional part = time)
- Range: January 1, 0001 to December 31, 9999
Boolean Type
ThedkBoolean type stores true/false values:
Type Detection
IsNumeric Helper
TheTDataKind type includes a helper method to check if a type is numeric:
Type Conversion
Convert between data kinds using the helper methods:Data Type Mapping
| TDataKind | Pascal Type | Array Type | Size (bytes) |
|---|---|---|---|
| dkInt32 | Integer | TInt32Array | 4 |
| dkInt64 | Int64 | TInt64Array | 8 |
| dkSingle | Single | TSingleArray | 4 |
| dkDouble | Double | TDoubleArray | 8 |
| dkExtended | Extended | TExtendedArray | 10 (x86) / 8 (x64) |
| dkText | String | TTextArray | Variable |
| dkDateTime | TDateTime | TDateTimeArray | 8 |
| dkBoolean | Boolean | TBooleanArray | 1 |
Converting Values to Strings
UseDataToString to convert any value to a string representation:
- Missing values (returns empty string)
- Type-specific formatting
- DateTime conversion
- Boolean to string conversion
Working with Different Types
Type-Safe Access
Numeric Operations
Type Selection Guidelines
Choose integer for whole numbers
Use
dkInt32 for most integers, dkInt64 only when needed for very large values.Choose double for decimal numbers
dkDouble is the recommended floating-point type for most scenarios.Use single for memory-constrained scenarios
Only choose
dkSingle when processing millions of values and memory is critical.Best Practices
Type Consistency
Keep the same data type throughout a column. Don’t mix different numeric types.
Memory Efficiency
Choose the smallest type that fits your data range to optimize memory usage.
Precision Awareness
Be aware of floating-point precision limits when comparing values or performing calculations.
Unicode Support
Use
dkText for all string data - it fully supports Unicode characters.Next Steps
Data Items
Learn about TDataItem structure and usage
Arrays
Explore array operations and performance
