Skip to main content

Data Types

Velox scripts use RemObjects PascalScript types mapped into the Delphi process. Most names resemble Delphi, but the exact current registrations—not the name alone—control width, encoding and runtime interoperability.

Type selection

NeedPreferExact current boundary
True/false stateBooleanTwo-value (False, True) script enumeration.
Unsigned 8-bit value or raw byteByte0..255; not a text character.
Unsigned 16-bit valueWord0..65,535.
Signed 32-bit valueIntegerAlias of hidden LongInt; fixed 32-bit.
Unsigned 32-bit valueCardinalAlias of hidden LongWord; fixed 32-bit.
Signed/unsigned 64-bit valueInt64 / UInt64Fixed 64-bit; check external Variant/JSON/database support.
Pointer-sized integerNativeInt / NativeUInt32-bit in Win32 Velox, 64-bit in Win64 Velox.
Approximate real valueSingle, Double, ExtendedBinary floating point; Extended changes precision by executable architecture.
Four-decimal fixed-point valueCurrencySigned Int64 scaled by 10,000.
Managed textStringUnicodeString/UTF-16; 1-based code-unit indexing.
One public script characterCharEight-bit AnsiChar despite Unicode String.
Legacy NUL-terminated pointerPCharBorrowed PAnsiChar-style pointer; avoid for normal text.
Delphi date/time serialTDateTimeDouble days from 1899-12-30; no timezone metadata.
GUID valueTGUIDPlain 16-byte field record; no imported record methods.
Dynamically tagged valueVariantDistinguishes Empty, Null, scalars and arrays.
Inspect a Variant tagTVarTypeWord base code plus flags; mask before comparing.

Architecture and encoding rules

The script compiler derives NativeInt/NativeUInt width from the CPU architecture of the running Velox executable. Never put a Native value into a persistent schema, file or wire contract. Use an explicit fixed-width type.

The current compiler registers String as UnicodeString, but its public Char/PChar registrations use PascalScript's internal AnsiChar/PAnsiChar types. A String position is a UTF-16 code unit; a Char can hold only one byte. Non-ASCII String-to-Char/PChar paths can therefore narrow or depend on an ANSI conversion. Use String for text and Byte/byte arrays for data.

Importers can also define UTF8String as AnsiString for selected APIs. That value contains UTF-8 bytes even though a normal String is UTF-16 text. Preserve the documented encoding at every boundary instead of relying on implicit casts.

Numeric and dynamic-value rules

Choose by range and semantics, not by convenience. Validate before narrowing, especially at importer properties whose declaration is narrower than the native Delphi value. Do not depend on overflow wrapping, implicit signed/unsigned conversion or floating-point equality for business correctness.

Single, Double and Extended are approximate binary values. Currency is exact only to four decimal places. TDateTime is a Double with date/time conventions layered on top and should use date functions rather than raw floating arithmetic for calendar operations.

Variant is convenient at Velox boundaries but shifts validation to runtime. Test Null/Empty explicitly, inspect VarType when shape matters and convert once into a strong local type. Never assume Null equals an empty String or zero.

Interchange guidance

  • Match database column range, signedness, precision and nullability explicitly.
  • Serialize 64-bit integers as strings when a JSON/JavaScript consumer cannot preserve them exactly.
  • Format date/time and numeric output with an invariant documented contract; default conversion can use server locale.
  • Use GUID conversion functions rather than manually joining record fields or raw memory.
  • Never use PChar or native-sized integers as persistent identifiers.
  • Treat managed Strings, Variants, arrays and record values as local values; do not expose their process memory layout.

External references

Created 2026-07-15