Function DbCloseArea() Foundation

Closes files in a work area.

Syntax
DbCloseArea() --> NIL
Return

The return value of DbCloseArea() is always NIL.

Description

All files (database and indexes) in a single work area are closed by the database function DbCloseArea(). When the function is used without the alias operator, the files are closed in the current work area. All open file buffers are written into the files before they are closed. Also, all locks are released and filters or relations are cleared before closing.

The commands CLOSE and USE can be used instead of DbCloseArea(). These commands are only effective in the current work area.

Examples
DbCloseArea()
// In the example, three database files are opened and then 
// sequentially closed with DbCloseArea(). 

PROCEDURE Main 
   ? Select()                  // result: 0 

   USE Customer NEW 
   ? Select()                  // result: 1 

   USE Invoice NEW 
   ? Select()                  // result: 2 

   USE InvItem NEW 
   ? Select()                  // result: 3 

   Customer->( DbCloseArea() ) 
   ? Select("Customer")        // result: 0 

   (2)->( DbCloseArea() ) 
   ? Select("Invoice")         // result: 0 

   ? Select()                  // result: 3 

   DbCloseArea() 
   ? Select()                  // result: 0 

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.