&H (Numerical prefix)

A number may be expressed in hexadecimal form in SmileBasic by using the prefix. For a numeric literal,  is converted to , and lowercase digits   to   are converted to uppercase   to  , so for example   gives  , but   gives  , and   gives. Another difference between the way  is handled in literals and in   is that   does not require any digits to follow:   makes a , but   gives.

If more than 5 hexadecimal digits follow the prefix in a literal, the system will generate a, even if the first digits are   and the value is within SmileBasic's range. If more than 5 hexadecimal digits follow the prefix in a string passed to, the system instead generates an   error, again even if the value is within SmileBasic's range. The values  to   give negative numbers in the standard 2s complement sense, and   in particular is a value which exposes some bugs in SmileBasic.

For some operators, it is not necessary to put a space between the end of the literal and the operator, e.g.  will give   as expected, but for others, it is necessary, e.g.   gives the confusing result , and the assignment   generates a. The commands  and   will give the expected results.

The prefix for binary values is.