Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Advantage CA-Clipper Guide v6.11 - set tag http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 SET TAG
 Select a tag within a .cdx file to be controlling order
------------------------------------------------------------------------------

 Syntax

     SET TAG TO [<cTagName> [IN <cCDXName>]]

     <cTagName> identifies the tag to which the order is to be set.

     <cCDXName> specifies which .cdx file contains the specified tag.
     If a .cdx file is not specified, the open .cdx indexes are searched
     for the tag in the order they were opened.

 Description

     SET TAG allows the user to select a tag within a .cdx file to be the
     controlling index.  Once the tag is found, the order is set to the
     .cdx file, and control is given to the specified tag.  If <cCDXName>
     is specified, then only that index file is searched for the specified
     tag name.  Otherwise, with CA-Clipper 5.01, the structural .cdx is
     searched, followed by the active .cdx files in the order by which
     they were opened.  CA-Clipper 5.2 searches the active .cdx files in
     the order by which they were opened.

     Once the tag is found, it becomes the active tag.  The index order is
     set to the position of the index containing the tag.  If <cTagName>
     is not specified, the order is set to zero and the table is
     accessed in natural (record number) order.

     Note:  This command behaves exactly like Advantage SET ORDER TO TAG
     command.  The commands are interchangeable.

 Example

     #include "DBFCDXAX.CH"

     // Assume TEST.DBF has a TEST.CDX file with tags AGE and STATE

     USE test VIA "DBFCDXAX"   // Open TEST.DBF and TEST.CDX

     SET TAG TO age            // Selects the AGE tag

     // Create a new last.idx file.  This makes last.idx
     // the active order and pushes test.cdx to the end
     // of the order (in this case order 2).
     INDEX ON last to last

     // Select TEST.CDX which still has the AGE tag active.
     SET ORDER TO 2

     // Select the STATE tag, and set the order to the
     // TEST.CDX file since it includes the STATE tag
     SET TAG TO state

     // Select last.idx which is in order 1
     SET ORDER TO 1


See Also: SET ORDER TO TAG AX_SetTag() AX_SetTagNo()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson