Returns the hexadecimal wstring (Unicode) representation of a number
Syntax
Usage
result = WHex( number [, digits ] )
Parameters
number
A whole number or expression evaluating to a whole number.
digits
Optional number of digits to return.
Return Value
Returns a hexadecimal
String representation of
number.
Description
Hexadecimal digits range from 0-9, or A-F.
If you specify
digits > 0, the resulting
WString will be exactly that length. It will be truncated or padded with zeros on the left, if necessary.
The length of the wstring will not go longer than the maximum number of digits required for the type of
expression (8 for an integer, 16 for floating point or longint)
Example
Print Hex(54321)
Print Hex(54321, 2)
Print Hex(54321, 5)
will produce the output:
D431
31
0D431
Platform Differences
- Unicode (w)strings are not supported in the DOS port of FreeBASIC.
Dialect Differences
- Not available in the -lang qb dialect unless referenced with the alias __Whex.
Differences from QB
See also