CHAR (BASIC 3.5)

From C64-Wiki
Jump to navigationJump to search
Disambiguation The title of this article is ambiguous. Char (Disambiguation).


BASIC keyword
Keyword: CHAR
Abbreviation: CH SHIFT-A
Type: Command
Token code: 224/$E0
Handling routine
in BASIC ROM:
List of all BASIC keywords


Remark: This article describes the BASIC command CHAR in Commodore BASIC V3.5 or higher.

Type: Command
General Programming-Syntax: CHAR <color source>, <column>, <row>, <string$>, <reverse flag>

The BASIC command CHAR positions the printing of a string in any graphics mode. In text mode, it is similar to the PRINT AT command in some other versions of BASIC, and can replace dozens of cursor commands used to move around the screen.

The parameters are:

  • <Color Source> can be 0 (background color) or 1 (foreground color).
  • <Column> is the X coordinate, (0-79) - In 40 column mode, Column values higher than 39 will wrap around to the next line.
  • <Row> is the Y coordinate, (0-24).
  • You can print strings like "ABCD123" and string variables like A$. To print a number, use the STR$ function to convert it to a string.
  • When the <reverse flag> is set to 0, CHAR will print normally, and when set to 1, the text will be printed in reverse color.

Examples[edit | edit source]

CHAR 1,4,12,"Hello World",0    Moves cursor on screen to line 4 and row 12 and prints "Hello World" 


BASIC V7.0 Commands

ABS | AND | APPEND | ASC | ATN | AUTO | BACKUP | BANK | BEGIN | BEND | BLOAD | BOOT | BOX | BSAVE | BUMP | CATALOG | CHAR | CHR$ | CIRCLE | CLOSE | CLR | CMD | COLLECT | COLLISION | COLOR | CONCAT | CONT | COPY | COS | DATA | DCLEAR | DCLOSE | DEC | DEF FN | DELETE | DIM | DIRECTORY | DLOAD | DO | DOPEN | DRAW | DS | DS$ | DSAVE | DVERIFY | EL | ELSE | END | ENVELOPE | ER | ERR$ | EXIT | EXP | FAST | FETCH | FILTER | FN | FOR | FRE | GET | GET# | GETKEY | GO64 | GOSUB | GOTO | GRAPHIC | GSHAPE | HEADER | HELP | HEX$ | IF | INPUT | INPUT# | INSTR | INT | JOY | KEY | LEFT$ | LEN | LET | LIST | LOAD | LOCATE | LOG | LOOP | MID$ | MONITOR | MOVSPR | NEW | NEXT | NOT | (OFF) | ON | OPEN | OR | PAINT | PEEK | PEN | (PI) | PLAY | POINTER | POKE | POS | POT | PRINT | PRINT USING | PRINT# | PUDEF | (QUIT) | RCLR | RDOT | READ | RECORD | REM | RENAME | RENUMBER | RESTORE | RESUME | RETURN | RGR | RIGHT$ | RND | RREG | RSPCOLOR | RSPPOS | RSPRITE | RUN | RWINDOW | SAVE | SCALE | SCNCLR | SCRATCH | SGN | SIN | SLEEP | SLOW | SOUND | SPC( | SPRCOLOR | SPRDEF | SPRITE | SPRSAV | SQR | SSHAPE | ST | STASH | STEP | STOP | STR$ | SWAP | SYS | TAB( | TAN | TEMPO | THEN | TI | TI$ | TO | TRAP | TROFF | TRON | USR | VAL | VERIFY | VOL | WAIT | WHILE | WINDOW | WIDTH | XOR