25.25. CLOSE [ # ] fn

[<<<] [>>>]

Close a previously successfully opened file. The argument of the command is the file number that was used in the command OPEN to open the file.

If the file number is not associated with a successfully opened file then error is raised.

REM open the file to read
open "test.bas" for input as 1
REM close the file
close#1

REM open two files for reading open "test.bas" for input as 1 open "test.sb" for input as 2

REM close all files close

Close a previously successfully opened file. The argument of the command is the file number that was used in the command OPEN to open the file.

If the file number is not associated with a successfully opened file then error is raised.

You can also use the command without any argument. In this case all currently opened files and sockets are going to be closed. For those, who want to express this behaviour this command can be used with the keyword CLOSEALL. Note however that the keyword CLOSEALL is not a replacement for the keyword CLOSE. You can not close a single file or socket using the keyword CLOSEALL.

Close a previously successfully opened file. The argument of the command is the file number that was used in the command OPEN to open the file.

If the file number is not associated with a successfully opened file then error is raised.


[<<<] [>>>]