Function OrdBagName() Foundation

Returns the filename of the file containing an index.

Syntax
OrdBagName( <nIndex> | <cTagName>, [<nInfo>] ) --> cIndexFile
Parameters
<nIndex>
<nIndex> is a positive integer specifying the ordinal position within a work area of the index whose associated filename is returned. Indexes in a work area are numbered in the order they were opened.
<cTagName>
<cTagName> is a character string containing the name of the index whose associated filename is returned.
<nInfo>
A #define constant from DMLB.CH must be used for <nInfo>.
Constants for OrdBagName()
Constant Description
DMLB_FILENAME Function returns file name.
DMLB_QUALIFIED_FILENAME Function returns file name including path.
Return

The return value of OrdBagName() is a character string containing the file name of the index file containing the specified index. When no index is active, a null string ("") is returned.

Description

The index function OrdBagName() determines which index of a work area is managed in which index file. When the function is used without the alias operator, it returns the filename for the current work area.

Examples
OrdBagName() with SET INDEX TO
// The example shows the return values of OrdBagName() after 
// index files were opened with the command SET INDEX TO. 

PROCEDURE Main 
   USE Customer NEW 
   SET INDEX TO CustA, CustB, CustC 

   ? OrdBagName(1)      // result: CustA 
   ? OrdBagName(2)      // result: CustB 
   ? OrdBagName(3)      // result: CustC 
   ? OrdBagName(4)      // result:         (null string ("")) 

   CLOSE Customer 
RETURN 
OrdBagName() with OrdListAdd()
// The example shows the return values of OrdBagName() after 
// index files were opened with the function OrdListAdd(). 

PROCEDURE Main 
   USE Customer NEW 
   OrdCreate( "CustA", "CustNo", "CUSTNO" ) 
   OrdCreate( "CustB", "CustName", "Upper(LASTNAME+FIRSTNAME)") 
   OrdCreate( "CustC", "Zipcode", "ZIP" ) 

   OrdListClear() 

   OrdListAdd("CustA") 
   OrdListAdd("CustB") 
   OrdListAdd("CustC") 

   ? OrdBagName("CustNo")            // result: CustA 
   ? OrdBagName("CustName")          // result: CustB 
   ? OrdBagName("Zipcode")           // result: CustC 

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