|Abbreviation:||C, L, Shift+O|
in BASIC ROM:
|List of all BASIC keywords|
Type: Command General Programming-Syntax: CLOSE <logical filenumber>
The BASIC command CLOSE is used for closing currently opened files or drive numbers, so that the data can be written from the write buffer on tape or disk. If CLOSE is omitted after opening a file, the data of the file can be incomplete or even unreadable. As a rule, CLOSE should be used whenever an OPEN occured and any of the BASIC commands CMD, GET#, INPUT# or PRINT# has been used, but no further file access is needed anymore.
The numerical values from 0 to 255 are valid logical file numbers. Beyond that range -with negative values or values greater than 255- the BASIC error "?ILLEGAL QUANTITY ERROR will be shown.
Close logical file 1:
Close a file with logical file number in variable Z:
10 CLOSE Z
Z's value may be between 0 and 255.
Opens the keyboard device as a logical file for input:
200 OPEN 5,0: INPUT#5, A$: CLOSE5
This lets the user type something with a blinking cursor but without the question mark printed, which is the case for an INPUT from the default input file)