GET(hash)

From C64-Wiki

Jump to: navigation, search
BASIC keyword
Keyword:GET#
Abbreviation:./.
Type:Command
Token code:---/---
Handling routine
in BASIC ROM:
---;---
$----;----
List of all BASIC keywords


Remark: This article describes the BASIC-Command GET# in BASIC V2 on the Commodore 64.

Type: Command
General Programming-Syntax: GET# <logic file number>,<variable>[,<variable>...]

The BASIC-command GET# reads single characters from the specified device or the opened file. Before GET# can be used, it is necessary to open the device or the file with the command OPEN with the same logical file number. The character read in this way is stored in a variable (string, floating point, integer). If this variable is of a numeral type and the character is no numeral, the interpreter will report a "?SYNTAX ERROR IN line" XYZ. Therefore, string variables are preferable to foolproof the use of GET#. Furthermore, GET# cannot be used outside of BASIC programs. Otherwise an "?ILLEGAL DIRECT ERROR" will occur.

All characters are accounted for. An exception is the use of GET# on the screen. After every reading operation from the screen, the cursor moves one column to the right and the end of a logical screen line (after 80 characters) is automatically set the Return character = CHR$(13).

[edit] Examples

10 REM COPYING 255 SCREEN CHARACTERS TO A STRING VARIABLE
20 PRINT CHR$(19);: B$="": OPEN 1,3
30 GET#1,A$: B$=B$+A$: IF LEN(B$)<255 THEN 30
40 CLOSE 1
50 PRINT CHR$(147);B$
BASIC V2.0-Commands of Commodore 64

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

 
Personal tools
Help and Feedback
In other languages