END

From C64-Wiki
Jump to navigationJump to search
BASIC keyword
Keyword: END
Abbreviation: E Shift+N
Type: Command
Token code: 128/$80
Handling routine
in BASIC ROM:
43057–43094
$A831–A856
List of all BASIC keywords


Remark: This article describes the BASIC command END in BASIC V2 on the Commodore 64.

Type: Command
General Programming Syntax: END

The BASIC command END ends the processing of the current program which let interpreter switch back to direct mode, printing the prompt READY. and waiting for input.

Any BASIC code following the END statement won't be processed, but the BASIC commands CONT or RUN [<Line Number>] can be used to resume execution.

Usually END is used somewhere in the middle of program, normally it is not needed at the end of a program, because the program will implicitly end after the last line executed.

Examples[edit | edit source]

The command END is only useful in more complex BASIC programs, which are not necessarily ending at the last program line!

10 INPUT "WRITE SOMETHING: "; A$
20 PRINT: PRINT "YOUR INPUT: "; A$
30 B$ = "": PRINT: PRINT "PLEASE EXIT WITH KEY <E>!"
40 GET B$: IF B$="" THEN 40
50 IF B$="E" THEN END
60 PRINT: PRINT "RESTART": GOTO 10
...other subroutines or data...
BASIC V2.0 (second release) Commands

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