xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

Used()

Determines if a database file is open in a work area.

Syntax

Used() --> lIsUsed

Return

The function returns .T. (true) if a database file is open in a specified work area, otherwise .F. (false) is returned.

Description

Used() determines if a database file is open in a work area, i.e. if a work area is "used". If the function is called without the alias operator, it operates in the current work area. The current work area is selected with function DbSelectArea().

Info

See also:Alias(), DbSelectArea(), DbUseArea(), SELECT, Select(), USE
Category: Database functions , Environment functions
Source:rdd\dbcmd.c
LIB:xhb.lib
DLL:xhbdll.dll

Example

// The shows how to query the Used status of work areas

   PROCEDURE Main
      ? Select()                       // result:  1
      ? Used()                         // result: .F.

      USE Customer ALIAS Cust NEW
      ? Select()                       // result:  1
      ? Used()                         // result: .T.

      DbSelectArea( 2 )
      ? Select()                       // result:  2
      ? Used()                         // result: .F.

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

      CLOSE Cust
   RETURN

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