Skip to main content

IntToStr

function IntToStr(I: Int64): String;

Example

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

Usage

IntToStr formats the script runtime's signed Int64 value as decimal text.

Parameters

NameTypeDescription
IInt64Signed 64-bit value to format. Smaller integer types are converted by the script call rules.

Returns

Only the decimal digits required to represent the magnitude, with a leading ASCII minus sign for a negative value. There is no plus sign, leading padding, thousands separator or locale-specific formatting.

Errors

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

Usage notes

Use this function for stable machine-readable decimal integer text. If the receiving field requires padding or a sign for positive values, apply that separate format contract explicitly rather than expecting IntToStr to do it.

Additional Technical Info

IntToStr returns the base-10 text for a signed integer. In the current Velox PascalScript build its declaration accepts Int64, so the full signed 64-bit range is supported despite the shorter function name.

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

Implementation

IntToStr is installed by the modified PascalScript compiler as a standard function. With current Int64 support enabled, runtime dispatch case zero reads an Int64 argument and calls Delphi System.SysUtils.IntToStr(Int64). This is not a separate Velox numeric-formatting algorithm.

Delphi's terminal handles the complete signed range, including the minimum Int64 value.

Edge cases and quirks

  • Zero returns 0; positive values have no + prefix.
  • Output is locale-independent and contains no grouping separators.
  • The current Int64ToStr standard function selects a separate PascalScript dispatch case but the same Delphi Int64 formatter, so its output is identical.
  • In a PascalScript build compiled without Int64 support, the installed declaration and runtime argument width would differ. That is not the reviewed Velox configuration.

Side effects

None outside result-string allocation.

Performance and concurrency

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

Related entries

  • Int64ToStr is the explicit 64-bit alias in the current PascalScript runtime.
  • IntToHex returns uppercase hexadecimal bit-pattern text.
  • FloatToStr has locale and precision behaviour that does not apply here.

External references

Created 2026-07-15