WHex

Returns the hexadecimal KeyPgWstringWString (Unicode) representation of a number

Syntax
	KeyPgDeclareDeclare KeyPgFunctionFunction WHex ( KeyPgByvalByVal number KeyPgAsAs KeyPgUbyteUByte ) KeyPgAsAs KeyPgWstringWString
	KeyPgDeclareDeclare KeyPgFunctionFunction WHex ( KeyPgByvalByVal number KeyPgAsAs KeyPgUshortUShort ) KeyPgAsAs KeyPgWstringWString
	KeyPgDeclareDeclare KeyPgFunctionFunction WHex ( KeyPgByvalByVal number KeyPgAsAs KeyPgUlongULong ) KeyPgAsAs KeyPgWstringWString
	KeyPgDeclareDeclare KeyPgFunctionFunction WHex ( KeyPgByvalByVal number KeyPgAsAs KeyPgUlongintULongInt ) KeyPgAsAs KeyPgWstringWString
	KeyPgDeclareDeclare KeyPgFunctionFunction WHex ( KeyPgByvalByVal number KeyPgAsAs KeyPgConstConst KeyPgAnyAny KeyPgPtrPtr ) KeyPgAsAs KeyPgWstringWString

	KeyPgDeclareDeclare KeyPgFunctionFunction WHex ( KeyPgByvalByVal number KeyPgAsAs KeyPgUbyteUByte, KeyPgByvalByVal digits KeyPgAsAs KeyPgLongLong ) KeyPgAsAs 
	KeyPgWstringWString
	KeyPgDeclareDeclare KeyPgFunctionFunction WHex ( KeyPgByvalByVal number KeyPgAsAs KeyPgUshortUShort, KeyPgByvalByVal digits KeyPgAsAs KeyPgLongLong ) KeyPgAsAs
	KeyPgWstringWString
	KeyPgDeclareDeclare KeyPgFunctionFunction WHex ( KeyPgByvalByVal number KeyPgAsAs KeyPgUlongULong, KeyPgByvalByVal digits KeyPgAsAs KeyPgLongLong ) KeyPgAsAs 
	KeyPgWstringWString
	KeyPgDeclareDeclare KeyPgFunctionFunction WHex ( KeyPgByvalByVal number KeyPgAsAs KeyPgUlongintULongInt, KeyPgByvalByVal digits KeyPgAsAs KeyPgLongLong ) 
	KeyPgAsAs KeyPgWstringWString
	KeyPgDeclareDeclare KeyPgFunctionFunction WHex ( KeyPgByvalByVal number KeyPgAsAs KeyPgConstConst KeyPgAnyAny KeyPgPtrPtr, KeyPgByvalByVal digits KeyPgAsAs 
	KeyPgLongLong ) KeyPgAsAs KeyPgWstringWString

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 KeyPgWstringWString representation of number, truncated or 
	padded with zeros ("0") to fit the number of digits, if specified.

Description
	Hexadecimal digits range from 0-9, or A-F.

	If you specify digits > 0, the resulting KeyPgWstring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 a KeyPgLongLong, 16 for 
	floating point or KeyPgLongintLongInt)

Example
	Print Hex(54321)
	Print Hex(54321, 2)
	Print Hex(54321, 5)

	will produce the output:
	D431
	31
	0D431

Platform Differences
	* Unicode strings are not supported in the DOS port of FreeBASIC.

Dialect Differences
	* Not available in the CompilerOptlang-lang qb dialect unless referenced with the 
	  alias __Whex.

Differences from QB
	* New to FreeBASIC.

See also
	* KeyPgHexHex
	* KeyPgWbinWBin
	* KeyPgWoctWOct

