Petit Computer Wiki
Advertisement

V1[]

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

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.

V3[]

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.).

Advertisement