Command CLOSE Foundation

Closes all files or a specific group of files.

Syntax
CLOSE [<cAlias> | ALL | ALTERNATE | DATABASES | INDEXES]
Parameters
<cAlias>
This argument is either a literal alias name or a character expression containing the alias name in parentheses. The alias name indicates the work area whose files are to be closed.
ALL
Specifying ALL closes all files in all work areas.
ALTERNATE
The option ALTERNATE closes the file opened with the command SET ALTERNATE TO <cFile>. This has the same effect as the SET ALTERNATE TO command without specifying an argument.
DATABASES
The option DATABASES closes all data, memo and index files in all work areas. The alternate file remains open.
Description

The command CLOSE closes various kinds of file, depending on the options and arguments specified. When CLOSE is called without any options or arguments, the command closes the files in the current work area. This has the same effect as the command USE without specifying an argument.

Examples
CLOSE
// In the example, a customer file is opened along with its 
// index files. CLOSE is used to first close the index files 
// and then the customer file. 

PROCEDURE Main 

    USE Customer ALIAS Cust INDEX CustA, CustB, CustC 

    ? IndexOrd()             // result: 1 

    CLOSE INDEXES 

    ? IndexOrd()             // result: 0 
    ? Alias()                // result: CUST 

    CLOSE Cust 
    ? Alias()                // result:   (Null string ("")) 

RETURN 
Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.