Hex (function)

<< Click to Display Table of Contents >>

Hex (function)

Hex(Num)

Returns a string with the hexadecimal representation of the given number.

Num can be any numeric expression; it is rounded to the next integer.

The result can be up to eight digits long.

See also: Oct

Example:

Sub Main

 Dim Msg As String, x%

 x% = 1024

 Msg =Str(x%) & " decimal is identical to "

 Msg = Msg & Hex(x%) & " hexadecimal."

 MsgBox Msg

End Sub