DIAdem Help

Method: Hex for VBS

  • Updated2024-09-12
  • 1 minute(s) read

Method: Hex for VBS

Specifies the hexadecimal display of a number. You can enter a hexadecimal number directly by inserting the characters &H in front of the hexadecimal number.

vHex = Object.Hex(number)
ObjectVBS
Object with this method. You do not need to specify this object.
numberVariant
Specifies any expression. If number is not an integer, the Hex method first rounds the number value.
vHexVariant
Receives a character string in hexadecimal notation.

The following example returns the hexadecimal value of various numbers:

Call MsgBox(Hex(4))    ' Returns 4.
Call MsgBox(Hex(31))   ' Returns 1F
Call MsgBox(Hex(4711)) ' Returns 1267

See Also

Objects Overview

Related Topics

Abs | Asc | AscB | AscW | CBool | CByte | CCur | CDate | CDbl | CInt | CLng | CSng | CStr | ChrB | ChrW | Chr | Escape | Fix | Hex | Int | Oct | Sgn | UnEscape