Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

VBScript Hex function


May 13, 2021 VBScript


Table of contents


VBScript Hex function

The VBScript Hex function is used to return a string that represents the hex value of a number.


VBScript Hex function Complete VBScript reference manual

The Hex function returns a string that represents the hex value of the specified number.

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

Grammar

Hex(number)

Parameters

parameter describe
number Required.Any effective expression.

If the number is:

  • Null - Then the HEX function returns NULL.
  • Empty - Then the HEX function returns zero (0).
  • Any Other Number - Then the HEX function returns 8 hexadecimal characters.
<script type="text/vbscript">

document.write(Hex(3) & "<br />")
document.write(Hex(5) & "<br />")
document.write(Hex(9) & "<br />")
document.write(Hex(10) & "<br />")
document.write(Hex(11) & "<br />")
document.write(Hex(12) & "<br />")
document.write(Hex(400) & "<br />")
document.write(Hex(459) & "<br />")
document.write(Hex(460) & "<br />")

</script>

The above example output results:

3
5
9
A
B
C
190
1CB
1CC

Try it out . . .

VBScript Hex function Complete VBScript reference manual