xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

OrdBagName()

Retrieves the file name of an open index.

Syntax

OrdBagName( [<nOrder> | <cIndexName>] ) --> cIndexFilename

Arguments

<nOrder>
A numeric value specifying the ordinal position of the index open in a work area. Indexes are numbered in the sequence of opening, beginning with 1. The value zero identifies the controlling index.
<cIndexName>
Alternatively, a character string holding the symbolic name of the open index can be passed. It is analogous to the alias name of a work area. Support for <cIndexName> depends on the RDD used to open the index. Usually, RDDs that are able to maintain multiple indexes in one index file support symbolic index names, such as DBFCDX, for example.

Return

The function returns the name of the index file that contains the specified index as a character string. If no parameter is passed, the function returns the file name of the controlling index. If no index file is open, an empty string ("") is returned.

Description

OrdBagName() retrieves the name of the index file in which an index is stored. The index can be specified by its numeric ordinal position, or by its symbolic name specified with the TAG option of the INDEX command.

Info

See also:DbOrderInfo(), OrdBagExt(), OrdCreate(), OrdFor(), OrdKey(), OrdName(), OrdNumber(), RddName()
Category: Database functions , Index functions
Source:rdd\dbcmd.c
LIB:xhb.lib
DLL:xhbdll.dll

Example

// The example lists results of OrdBagName() using two different RDDs.

   REQUEST Dbfcdx

   PROCEDURE Main
      USE Customer VIA "DBFNTX"
      SET INDEX TO Cust01, Cust02

      ? OrdBagName()              // result: Cust01.ntx
      ? OrdBagName(1)             // result: Cust01.ntx
      ? OrdBagName(2)             // result: Cust02.ntx
      ? OrdBagName(3)             // result: (empty string)

      USE Invoice VIA "DBFCDX"

      SET INDEX TO Invoice

      ? OrdName() , OrdBagName()  // result: InvNo   Invoice.cdx
      ? OrdName(1), OrdBagName(1) // result: InvNo   Invoice.cdx
      ? OrdName(2), OrdBagName(2) // result: Custno  Invoice.cdx
      ? OrdName(3), OrdBagName(3) // result: (empty string)

      CLOSE ALL
   RETURN

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