Description

Converts hexadecimal, octal, or binary formatted data into internal system format (decimal numbers). The value to convert can be as great as that represented with 32 bits.

Syntax

internal = IConv (string"MX")

internal = IConv (string"HEX")

internal = IConv (string"MO")

internal = IConv (string"MB")

Parameters

IConv (MX, etc.) accepts arguments for the following parameters.

ParameterDescription
stringThe character range for each character in string is 0 - 9, A - F. Using characters outside the respective ranges will result in a conversion error.
MXThe parameter string must be a hexadecimal character set (base 16), it is converted to the equivalent decimal number (base 10).
HEXThe parameter string must be a string of hexadecimal character sets, it is converted to a string of ASCII values.
MOThe parameter string must be an octal (base 8), number, it is converted to a decimal number.
MBThe parameter string must be an ASCII representation of a binary (base 2) number; it is converted to a decimal number. If string yields an incorrect value, a 0 (zero) will be returned.

Remarks

An understanding of different number bases is required for the effective use of these specifications. Use the following table as a guide to conversions to different number bases.

Conversion CodeIconvOconv
MXhexadecimal to decimaldecimal to hexadecimal
MOoctal to decimaldecimal to octal
MBbinary to decimaldecimal to binary

Example

*Converting various number systems.
A = IConv("2A","MX")
* Output is 42
A = IConv('595A','HEX')
* Output is YZ
A = IConv("1000","MB")
* Output is 8
  • No labels