xHarbour Reference Documentation > Command Reference xHarbour Developers Network  

CLOSE

Closes one or more specified files.

Syntax

CLOSE [<cAlias> | ALL | ALTERNATE | DATABASES | FORMAT | INDEXES ]

Arguments

<cAlias>
This is the alias name of the work area whose files should be closed. It can be specified as a literal alias name or a character expression enclosed in parentheses.
ALL
This option closes all files in all work areas. Work areas become unused with all filters, indexes, relations and format definitions released. In addition, alternate files are closed.
ALTERNATE
Only the currently open alternate file is closed. The option has the same effect as issuing the SET ALTERNATE TO command without a file name.
DATABASES
All files associated with work areas are closed. This affects database, index and memo files. All work areas become unused with all filters, indexes and relations released. The current format definition stays intact.
FORMAT
Only the currently defined format definition is released. The option has the same effect as issuing the SET FORMAT TO command without a format name.
INDEXES
All index files open in the current work area are closed.

Description

The CLOSE command accepts various options to specify one of more files to close. When it is invoked without an option, the files in the current work area are closed. This has the same effect as the USE command called with no file name.

Info

See also:DbCloseAll(), DbCloseArea(), QUIT, RETURN, SET ALTERNATE, SET INDEX, Set(), USE
Category: Database commands , Environment commands
Source:rdd\dbcmd.c, rtl\set.c
LIB:xhb.lib
DLL:xhbdll.dll

Example

// The example demonstrates the effect of the CLOSE command
// together with different options

   PROCEDURE Main

       USE Address ALIAS Addr INDEX Addr1, Addr2

       ? IndexOrd()             // result: 1

       CLOSE INDEXES

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

       CLOSE Addr
       ? Alias()                // result: ""

   RETURN

Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe