ToString (open)

Returns a string representation of an integer

Syntax

// Core function, no LOADLIB necessary

STRING FUNCTION ToString(INTEGER64 val, INTEGER radix)

Parameters

INTEGER64 val

Value to convert

INTEGER radix

Number system used in the string, ranging from 2 to 36. This parameter is optional and defaults to 10 (decimal system)

Return value

STRING

The number converted to a string value in the requested number system

Description

ToString creates a string representation of the specified integer in the specified base (radix)

A base of 10 indicates that the string should use decimal numbers, 8 octal, 16 hexadecimal, and so on. Note: you don't need to use the ToString function to merge integers to strings.

Examples

// returns "9"
STRING example1 := ToString(9, 10);

// returns "11"
STRING example2 := ToString(11);

// returns "12"
STRING example3 := ToString(10, 8);

// returns "ff00"
STRING example4 := ToString(65280, 16);