Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

VBScript Hex Function

VBScript Hex Function


VBScript reference manual Complete VBScript Reference Manual


The Hex function returns a string representing the hexadecimal value of a specified number.

**Note:** If the argument is not an integer, it is rounded to the nearest integer before the operation.

Syntax

Hex(number)

Parameters Description
number Required. Any valid expression.

If the number is:

  • Null - the Hex function returns Null.
  • Empty - the Hex function returns zero (0).
  • Any other number - the Hex function returns 8 hexadecimal characters.
  • |

    Example

    Example

    The example above produces the following output:

    3

    5

    9

    A

    B

    C

    190

    1CB

    1CC

    Try it »


    VBScript reference manual Complete VBScript Reference Manual