Futurebasic/Language/Reference/hexstring

Syntax
hexString$ = HEX$(expr)

Description
This function returns a string of hexadecimal digits which represent the integer value of. The returned string will consist of either 2, 4 or 8 characters, depending on which of,   or   is currently in effect. Note that if the value of  is too large to fit in a hex string of the currently selected size, the string returned by   will not represent the true value of.

In FB, integers are stored in standard "2's-complement" format, and the values returned by  reflect this storage scheme. You need to keep this in mind when interpreting the results of, especially when   is a negative number. For example:  returns " " when   is in effect; " " when   is in effect; and " " when   is in effect.

Note: To convert a string of hex digits into an integer, use the following technique:

can be a (signed or unsigned) byte variable, short-integer variable or long-integer variable. Byte variables can handle a  up to 2 characters in length; short-integer variables can handle a   up to 4 characters in length; long-integer variables can handle a   up to 8 characters in length.