CONT
BASIC keyword | |
Keyword: | CONT |
Abbreviation: | C Shift+O |
Type: | Command |
Token code: | 154/$9A |
Handling routine in BASIC ROM: |
43095–43120 $A857–A870 |
List of all BASIC keywords |
Remark: This article describes the BASIC command CONT in BASIC V2 at the Commodore 64.
Type: Command General Programming-Syntax: CONT
The BASIC-Command CONT is used to resume execution of a BASIC program, which either ended in with an END or a STOP command, or was halted by pressing the RUN/STOP .
Note that CONT fails to work if the BASIC program has been edited after right after a stop; editing the program recalculates and overwrites the start of variable memory pointers, effectively clearing the variable memory. Therefore, trying to CONTinue a program that was stopped, then edited, yields the BASIC error message ?CAN'T CONTINUE ERROR..
In case the program stop is caused by an error one might take a GOTO into consideration to continue at a line somewhere after the failing statement.
Any given parameter to CONT raises a ?SYNTAX ERROR.
An interesting usage of CONT might be as a halt statement, which is similar to a GOTO to the same line or a WAIT 0,1
, but shorter in code size. In contrast to WAIT a break with RUN/STOP is still possible. The line number showed is always from the line of the last executed END or STOP command, otherwise 0.
Examples[edit | edit source]
CONT in direct mode[edit | edit source]
10 PRINT "PART 1" 20 END : PRINT "AFTER 'END'" 30 PRINT "PART 2" RUN
shows
PART 1
After giving CONT one gets
AFTER 'END' PART 2
CONT as wait statement[edit | edit source]
10 PRINT "WAITING ..." 20 CONT
Run the program and breaking it with RUN/STOP leads to
WAITING ... BREAK IN 0 READY.
Since no END or STOP has been called before the line number is still in initialized to 0 even though the break happened at line 20.
ABS | AND | ASC | ATN | CHR$ | CLOSE | CLR | CMD | CONT | COS | DATA | DEF | DIM | END | EXP | FN | FOR | FRE | GET | GET# | GOSUB | GOTO | IF | INPUT | INPUT# | INT | LEFT$ | LEN | LET | LIST | LOAD | LOG | MID$ | NEW | NEXT | NOT | ON | OPEN | OR | PEEK | π | POKE | POS | PRINT | PRINT# | READ | REM | RESTORE | RETURN | RIGHT$ | RND | RUN | SAVE | SGN | SIN | SPC | SQR | STATUS/ST | STEP | STOP | STR$ | SYS | TAB | TAN | THEN | TIME/TI | TIME$/TI$ | TO | USR | VAL | VERIFY | WAIT