Indications are, HEX$ in SmileBasic V1 is identical to that in V2.


HEX$(number) will create a string representation of the hexadecimal value number, after it has been rounded down if it is not an integer. A to F are always in uppercase. If number is negative, the 2's complement in 20 bits is shown.

HEX$(number, digits) will create a string representation as above, but will always create a string which is digits characters long. digits must be between 1 and 5 (inclusive). If the number cannot be expressed in digits characters (including at least one sign bit for negative numbers), the function generates Illegal function call (HEX$).

In particular, ?HEX$(-1) gives FFFFF, ?HEX$(-524287) gives 80001, and ?HEX$(-524287.1) gives 800000.


Indications are, HEX$ in SmileBasic V3 is similar to that in V2 (except the signed integers appear to be stored in 32 bits, so digits is presumably allowed to be as much as 8, HEX$(-1) would make "FFFFFFFF", HEX$(-524287) would give FFF80001, etc.).

Ad blocker interference detected!

Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.