INPUT

From C64-Wiki
Jump to: navigation, search
Disambiguation The title of this article is ambiguous. INPUT (Disambiguation).
BASIC keyword
Keyword: INPUT
Abbreviation: -
Type: Command
Token code: 133/$85
Handling routine
in BASIC ROM:
43967–44037
$ABBF–AC05
List of all BASIC keywords


Remark: This article describes the BASIC-Command INPUT in BASIC V2 at the Commodore 64.

Typ: Command
General Programming-Syntax: INPUT ["<text/string>";]<Variable>[,<Variable>...]

The BASIC-command INPUT is used for data input in BASIC-programs. After the viewed text, which can be drop, appears an interrogation mark (?). Behind waits the blinking cursor for the input data. The data will be stored into variable (type: string, floating point or integer) after pushing the <RETURN>-key. When after entry viewed more interrogation marks (??), it must be more data inputed. Optionally can be instructed the text for more data input. When you know that, more datas can be entered with commas (,). By entering more than requested data the BASIC-error "?EXTRA IGNORED" occur. The overkill don't stored in the variables. By pushing <RETURN> without data entry the contain of the variables are the same.

By entering the wrong data (for example by input chars or strings in a integer variable) appears the BASIC-error "?REDO FROM START". That means, that the data must be inputed over again. When general used string variables these BASIC-error can be avoided. By using INPUT directly the BASIC-error "?ILLEGAL DIRECT ERROR" is viewed.

Examples[edit]

10 INPUT "First input, please "; A$
20 INPUT "Only numbers (2-times) "; A1, A2%
40 PRINT: PRINT "Your input was: " A$, A1, A2%
50 PRINT: PRINT "Once again 3 numbers ";
60 INPUT A1%, B, Z
70 PRINT: PRINT "At last 3 inputs ";
80 INPUT A$, B$, C$
90 PRINT: PRINT "Your last input was: "; A1%, B, Z, A%, B$, C$
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