HEX$
BASIC keyword | |
Keyword: | HEX$ |
Abbreviation: | H Shift+E |
Type: | Function |
Token code: | UNK |
Handling routine in BASIC ROM: |
UNK |
List of all BASIC keywords |
Remark: This article describes the BASIC function HEX$ in in Commodore BASIC V3.5 or higher.
Type: String Function General Programming-Syntax: HEX$(<numeric-expression>)
HEX$ can be used to convert a number to its hexadecimal equivalent.
HEX$(N) returns a 4 character string containing the hexadecimal representation of value N where N is 0 <= N <= 65535.
Examples[edit | edit source]
PRINT HEX$(1024)
Returns "0400"
PRINT HEX$(0)
Returns "0000"
PRINT HEX$(65535)
Returns "FFFF"
PRINT HEX$(65536)
Displays "?ILLEGAL QUANTITY ERROR"
ABS | ASC | ATN | AUTO | BACKUP | BOX | CHAR | CHR$ | CIRCLE | CLOSE | CLR | CMD | COLLECT | COLOR | CONT | COPY | COS | DATA | DEC | DEF | DELETE | DIM | DIRECTORY | DLOAD | DO | DRAW | DS | DS$ | DSAVE | END | EL | ELSE | ER | ERR$ | EXIT | EXP | FN | FOR | FRE | GET | GET# | GETKEY | GOSUB | GOTO | GRAPHIC | GSHAPE | HEADER | HELP | HEX$ | IF | INPUT | INPUT# | INSTR | INT | JOY | KEY | LEFT$ | LEN | LET | LIST | LOAD | LOCATE | LOG | LOOP | MID$ | MONITOR | NEW | NEXT | ON | OPEN | PAINT | PEEK | POKE | POS | PRINT | PRINT USING | PRINT# | PUDEF | RCLR | RDOT | READ | REM | RENAME | RENUMBER | RESTORE | RESUME | RETURN | RGR | RIGHT$ | RLUM | RND | RUN | SAVE | SCALE | SCNCLR | SCRATCH | SGN | SIN | SOUND | SPC | SQR | SSHAPE | STOP | STR$ | SYS | TAB | TAN | TRAP | TROFF | TRON | UNTIL | USR | VAL | VERIFY | VOL | WHILE | WAIT