,
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 16 or hex the value can be a raw binary data value (or text, which will be converted into a raw binary 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
``````

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
``````

The function can also be used to convert text to hexadecimal. The text is first converted to UTF8 encoded binary data, then to hexadecimal.

``````radixstr("hex","1") ☞ 31
``````

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.

• bigendianbinaryvalue( -- converts big endian binary data (a byte, word, or longword) into an unsigned number (see Binary Data).
• Binary Data -- Panorama allows a formula or procedure to work with raw binary data.
• binarydatabuild( -- builds a binary value by scanning a database and assembling individual binary values for every record (including unselected records) in the database.
• binarytotext( -- converts binary data into text, optionally using a specified encoding.
• binaryvalue( -- converts binary data (a byte, word, longword, or longlongword) into a number (see Binary Data).
• byte( -- converts a number into a single byte of binary data (see Binary Data).
• bytearray( -- extracts a value from an array of bytes (see [Binary Data]).
• bytepattern( -- converts a byte count to text: 543 Bytes, 543 Kb, 123 Mb, 3.2 Gb
• chunkarray( -- extracts a binary "chunk" from binary data (see Binary Data).
• Data Arrays -- A numbered collection of data values.
• Data Dictionaries -- Overview of Panorama's key/value data dictionaries.
• hex( -- converts a text item containing a hexadecimal number into a standard number (decimal).
• hexbyte( -- converts a limited range of decimal numbers to a two-digit hexadecimal number expressed as a text string.
• hexlong( -- converts a decimal number to an eight-digit hexadecimal number expressed as a text string
• hexstr( -- converts a number to text formatted as a hexadecimal number.
• hextobinary( -- converts a sequence of hexadecimal digits into a raw binary data value.
• hexword( -- converts a decimal number to a four-digit hexadecimal number expressed as a text string.
• littleendianbinaryvalue( -- converts little endian binary data (a byte, word, longword, or longlongword) into an unsigned number (see Binary Data).
• longlongword( -- converts a number into a 64 bit longword (8 bytes) of binary data (see Binary Data).
• longlongwordarray( -- extracts a value from an array of 64 bit longlongwords (see [Binary Data]).
• longword( -- converts a number into a 32 bit longword (4 bytes) of binary data (see Binary Data).
• longwordarray( -- extracts a value from an array of 32 bit longwords (see [Binary Data]).
• radix( -- converts a text item containing a number in a radix between 2 and 36 into a decimal number.
• signedbinaryvalue( -- converts binary data (a byte, word, longword, or longlongword) into a signed number (see Binary Data).
• texttobinary( -- converts text into binary data, optionally using a specified encoding.
• word( -- converts a number into a single word (2 bytes) of binary data (see Binary Data).
• wordarray( -- extracts a value from an array of 16 bit words (see Binary Data).

History

 Version Status Notes 10.0 Updated Carried 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.