Skip to main content

Int64ToStr

function Int64ToStr(I: Int64): String;

Example

procedure ScriptEvent(var Value: variant);
begin
Value := Int64ToStr(-1234567890); // '-1234567890'
end;

Usage

Parameters

NameTypeDescription
IInt64Any value in the signed 64-bit range.

Returns

Only the decimal digits required to represent the magnitude, with a leading ASCII minus sign for negative values. No plus sign, padding, thousands separator or locale-specific digit grouping is added.

Errors

String-allocation and script/value type-conversion failures can propagate. Every valid Int64 itself has a representation.

Usage notes

Use this name when the 64-bit intent is useful to a reader. Use IntToStr where existing script conventions prefer it; current Velox accepts an Int64 there as well.

Additional Technical Info

Int64ToStr returns the base-10 text for a signed 64-bit integer. It is a standard function implemented by the shipped PascalScript runtime and terminates in Delphi System.SysUtils.IntToStr(Int64).

The example is source-reviewed and is not executed by the documentation workflow.

Implementation

The modified PascalScript compiler registers this standard declaration when Int64 support is enabled. Its runtime dispatcher handles Int64ToStr separately from the shorter-named IntToStr, but both current branches call Delphi System.SysUtils.IntToStr(Int64).

The current Velox build includes Int64 support. Delphi's selected overload handles the full signed range, including -9223372036854775808, without first requiring that value to be represented as a positive Int64.

Edge cases and quirks

  • Zero returns 0; positive values have no leading plus sign.
  • The result is locale-independent and has no grouping separators.
  • Int64ToStr and IntToStr currently produce identical text for the same script value. They remain distinct PascalScript standard names and runtime dispatch cases.
  • The symbol would be unavailable in a PascalScript build compiled with PS_NOINT64; that option is not enabled in the reviewed Velox build.

Side effects

None outside result-string allocation.

Performance and concurrency

Constant bounded numeric conversion with no shared mutable state or locale dependency.

External references

Created 2026-07-15