CLOSE: Difference between revisions

From QB64 Phoenix Edition Wiki
Jump to navigation Jump to search
(Created page with "CLOSE closes an open file or port using the number(s) assigned in an OPEN statement. {{PageSyntax}} : CLOSE [{{Parameter|fileNumber}}[, ...]] {{Parameters}} * {{Parameter|fileNumber}} indicates the file or list of file numbers to close. When not specified, all open files are closed. {{PageDescription}} * A file must be closed when changing to another file mode. * CLOSE files when they are no longer needed, in order to save memory. * Files cannot be...")
 
(Add information on HTTP handles)
Line 1: Line 1:
[[CLOSE]] closes an open file or port using the number(s) assigned in an [[OPEN]] statement.
[[CLOSE]] closes an open file or port using the number(s) assigned in an [[OPEN]] statement.


Line 17: Line 18:
* Will not return an error if a filenumber is already closed or was never opened. It does not verify that a file was closed.
* Will not return an error if a filenumber is already closed or was never opened. It does not verify that a file was closed.
* [[CLEAR]] can be used to close all open files.
* [[CLEAR]] can be used to close all open files.
* [[CLOSE]] can also be used to close an open TCP/IP connection using a handle returned by '''QB64'''.
* [[CLOSE]] can also be used to close an open TCP/IP or HTTP connection using a handle returned by '''QB64'''.





Revision as of 07:48, 6 January 2023

CLOSE closes an open file or port using the number(s) assigned in an OPEN statement.


Syntax

CLOSE [fileNumber[, ...]]


Template:Parameters

  • fileNumber indicates the file or list of file numbers to close. When not specified, all open files are closed.


Description

  • A file must be closed when changing to another file mode.
  • CLOSE files when they are no longer needed, in order to save memory.
  • Files cannot be opened in the same OPEN mode using another number until the first one is closed.
  • Use holding variables for each file number returned by FREEFILE so that the file reference is known.
  • Will not return an error if a filenumber is already closed or was never opened. It does not verify that a file was closed.
  • CLEAR can be used to close all open files.
  • CLOSE can also be used to close an open TCP/IP or HTTP connection using a handle returned by QB64.


See also



Navigation:
Main Page with Articles and Tutorials
Keyword Reference - Alphabetical
Keyword Reference - By usage
Report a broken link