Click or drag to resize

Used Function

X#
Determine whether a database file is open.

Namespace:  XSharp.RT
Assembly:  XSharp.RT (in XSharp.RT.dll) Version: 2.19
Syntax
 FUNCTION Used() AS LOGIC
Request Example View Source

Return Value

Type: Logic
TRUE if there is a database file in use; otherwise, FALSE.
Remarks
Used() determines whether there is a database file in use in a work area.
By default, this function operates on the currently selected work area.
It can be made to operate on an unselected work area by specifying it within an aliased expression or by calling the overload that accepts a workarea parameter (a workarea number or alias ).
Examples
This example determines whether a database file is in use in the current work area:
X#
1USE customer NEW
2QOut(Used())            // Result: TRUE
3CLOSE
4QOut(Used())            // Result: FALSE
See Also