From Xojo Documentation

You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!


Used to represent a hexadecimal literal.



Part Type Description
HexNumber Hexadecimal number A hexadecimal literal value.


To write a hexadecimal literal, precede the value with &h.

Sample Code

Assign a number using a hex literal:

Var hex As Integer
hex = &hff // hex = 255 as a decimal integer

To get the numerical value (myValue) of a hexadecimal string (s):

Var myValue As Integer
myValue = Val("&h" + s)
// If s is "A4", myValue will contain the value 164 which corresponds to &hA4

See Also

Hex function.