CLOSE

From Liberty BASIC Family
Jump to navigation Jump to search
Supported in Just BASIC Supported in Liberty BASIC Not supported in Liberty BASIC 5 Supported in Run BASIC

Description

This command closes any file, window, or other device which has been opened in a program. Closing a file or device can help to prevent data loss and error messages.
See also OPEN.
See TRAPCLOSE for a proper method of handling the closing of a GUI program window.

Syntax

In each case, the handle name is the same handle used when the file or device was OPENed.

  1. close #Handle

Example

A typical usage of the close command:

' Open a disk file
    open "hello.txt" for output as #1

' Write something to the file
    print #1, "Hello, world"

' Close the file
    close #1

Useful Procedures

' Place a useful function or sub using this keyword here