Skip to main content

References

Available reference types

ReferenceExact targetMain use
DatasetTvxClientDataSetShort name for a Velox client-dataset object reference.
DateTimeTDateTimeShort name for Delphi's Double-backed date/time value.
DWORDLongWordWindows-style unsigned 32-bit value.
StreamTMemoryStreamShort name for a resizable memory-stream object reference.
StringListTStringListShort name for a mutable string-list object reference.
TFileNameStringSemantic name for text intended to represent a file path or name.
TSoundexIntLengthLongIntLength argument for the packed-Integer Soundex family.
TSoundexLengthLongIntLength argument for string Soundex generation and comparison.

What a reference means

These entries are type aliases, not reference-counted values and not the same feature as Delphi procedural or anonymous-method references. Four convenience names are created with the modified PascalScript compiler's type-copy operation; the remaining four are parsed from an ordinary target declaration. Both mechanisms resolve to an existing runtime type.

Consequently, declaring or assigning an alias performs no conversion and adds no policy:

  • scalar aliases keep the target's bit representation, arithmetic, precision and managed-value behavior;
  • class aliases hold the same object pointer, so assignment does not clone the object;
  • methods and properties are those of the target class, including members documented at a visible or hidden ancestor path;
  • object ownership is decided by the producer, not by the spelling of the variable's type;
  • semantic names such as TFileName do not validate the value; and
  • native Delphi subranges can disappear when an importer registers the alias as unrestricted script Integer.

Aliases and their exact targets can normally be used interchangeably in assignments and parameters. Prefer the public target type when its documentation makes the contract clearer, and use an alias when it matches an exposed declaration or improves the script's intent.

Ownership and mutation

Dataset, Stream and StringList are class references. Two variables can therefore point to the same mutable object. Navigation through one dataset alias changes the cursor seen through another; stream reads and writes share Position and bytes; list edits change the same collection. Assigning one variable to another never gives an independent copy.

Host-provided datasets remain host-owned. A script-created TMemoryStream or TStringList remains script-owned and must normally be released with Free in finally. A function can return a borrowed or transferred object, so read that function or property page before deciding who frees it.

Boundary guidance

  • Validate Soundex lengths before the call because the script aliases do not retain Delphi's nominal subranges.
  • Keep DWORD unsigned across Variant, signed database and JSON boundaries, especially above 2,147,483,647.
  • Carry timezone and format metadata separately from DateTime; the numeric value itself has neither.
  • Treat TFileName as untrusted text until the specific operation has applied an allowed-root, traversal, existence and access policy.
  • Snapshot dataset scalar values before any call that can navigate or rebuild the cursor.
  • Bound memory-stream and string-list growth from partner-controlled input.

No runtime, dataset, filesystem, stream, Soundex or image function was executed while documenting this branch.

External references

Created 2026-07-15