Function Used() Foundation

Determines whether a file is open in a work area.

Syntax
Used([<nWorkArea> | <cAlias>]) --> lIsUsed
Parameters
<nWorkArea>
<nWorkArea> is a positive integer specifying the ordinal number of the work area selected.
<cAlias>
Alternatively <cAlias> can be specified for <nWorkArea>. If used, <cAlias> is a character string containing the alias of the work area selected.
Return

Used() returns the value .T. (true) if a file is open in the specified work area. Otherwise it returns .F. (false).

Description

The database function Used() determines whether a file is open in a work area. If the function is used without the alias operator, it determines whether a file is open in the current work area.

Examples
Used()
// The example demonstrates the return value of Used() 
// for various work areas. 

PROCEDURE Main 
   USE Customer NEW 

   ? Select()              // result:  1 
   ? Used()                // result: .T. 

   ? (2)->(Used())         // result: .F. 

   ? Select("Invoice")     // result:  0 
   USE INVOICE NEW 

   ? Select("Invoice")     // result:  2 

   ? (1)->(Used())         // result: .T. 
   ? (2)->(Used())         // result: .T. 

   ? (3)->(Used())         // result: .F. 

   CLOSE DATABASES 
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.