Hex$(Function)
Converts the value of the expression to a character string hexadecimal expression.
Parameters
<Expression>
|
The expression to be converted to a character string (integer).
|
Return Value
None.
Description
The &H representing hexadecimal is not attached.
Specify a numeric value of 4 bytes or less in <Expression>.
Specify a numeric value in decimal as an integer as either a numeric constant or numeric variable in the <Expression>.
Negative numbers are expressed using a complement of 2.
In the case where the numeric value specified in <Expression> has a fractional part, it is rounded up to an integer at the first place after the radix point and then converted into a hexadecimal character string.
Example
Output the "A" result as a hexadecimal.
CHAR1$="A"
CODE&=Asc(CHAR1$)
CHAR2$=Hex$(CODE&)
The result is as follows:
CODE&=65
CHAR2$=41