radixstr(
RADIX
,
VALUE
)

The radixstr( function converts a number into a text item containing the equivalent number in a radix between 2 and 36.


Parameters

This function has two parameters:

radix – is the base for the numbering system you are converting to. You may specify any base from 2 to 36, or you can specify the radix as binary (same as 2), octal (same as 8) or hex (short for hexadecimal, same as 16).

value – is the number you want to convert. If the radix is 2, 16, binary, or hex the number can be a raw binary data value.


Description

The radixstr( function converts a number into a text item containing the equivalent number in a radix between 2 and 36. See Non Decimal Numbers for background information on hex, octal and binary numbers.

radixstr("hex",1234) ☞ 00000000000004D2
radixstr(16,1234) ☞ 00000000000004D2
radixstr(8,1234) ☞ 2322
radixstr(2,1234) ☞ 0000000000000000000000000000000000000000000000000000010011010010
radixstr(36,1234) ☞ YA
radixstr("binary",1234) ☞ 0000000000000000000000000000000000000000000000000000010011010010
radixstr("hex","abcd") ☞ 61626364

The radixstr( function can also be used to convert a binary data value to hexadecimal text. When a binary data value is used, hexadecimal (base 16) is the only available option.

radixstr("hex",longword(59833456)) ☞ 70FC9003
radixstr(16,longword(59833456)+longword(98384950)+longword(374958392)) ☞ 70FC9003363CDD0538695916

Error Messages

radixstr( function error: radix must be from 2–36, or ‘hex’, ‘octal’ or ‘binary’. – Choose a radix between base 2 and base 36.


See Also


History

VersionStatusNotes
10.0UpdatedCarried over from Panorama 6.0, but now supports any base between 2 and 36, not just 2, 4, 8 and 16. Also now supports input binary data using the binary data type, instead of the text type.