Hex - Built-in Miscellaneous Function¶
Purpose¶
Returns a hexadecimal string presentation of an integer.
Syntax¶
Hex(exp)
Arguments¶
| Argument | Required | Description |
|---|---|---|
exp |
Yes | Any integer expression. The value to be converted to a hexadecimal presentation. |
Returns¶
Variant with a String (VT_BSTR) value
Examples¶
return Hex(459) // returns 1CB
return ("The value of Hex(459) is:" * hex(459))
dim iLen
dim iPos
dim sChar
dim sHex
let iLen = len ({Vendor.Name})
let iPos = 1
let sHex = ''
while (iPos < iLen) do
let sChar = mid ({Vendor.Name}, iPos, 1)
let sHex = sHex + Hex (Asc (sChar))
let iPos = iPos + 1
end
return sHex
Notes¶
- When
expcannot be converted to an integer, a runtime error is generated. - The return value conforms to the standards for variant datatypes