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 v5.5 - ax_settagorder() http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 AX_SetTagOrder()
 Sets index order at the .cdx tag level
------------------------------------------------------------------------------

 Syntax

     AX_SetTagOrder( [<nPosition>] ) -> logical

     <nPosition> A numeric value specifying the index order position
     in the order list to select as the controlling order.

 Returns

     Returns a logical .T. if the operation was successful, else returns .F.
     If an error occurred, AX_Error() will return information on why the
     function failed.

 Description

     This function sets the index order at the individual order (.cdx tag)
     level.

     If <nPosition> is not specified or is zero (0), the index order is set to
     zero (record number order).

     If you are using .cdx indexes, you will find that CA-Clipper's 5.01
     dbSetOrder() function may not function as expected when attempting to
     select a tag within the .cdx file.  Note that the CA-Clipper 5.01
     dbSetOrder() function works at the file level.

     If you have a single .cdx file with five tags, and issue the function
     dbSetOrder(3), CA-Clipper 5.01 looks for the third index file, not the
     third index tag.  Since you are only using one index file, CA-Clipper
     5.01 will consider this an invalid request.  In this case, you will
     find the Advantage AX_SetTagOrder() function, which operated on the
     TAG level, useful.

     If you are using CA-Clipper 5.01, you can simply do a search and
     replace operation in your source code to convert all of your
     dbSetOrder() functions to the AX_SetTagOrder() function.

     Under CA-Clipper 5.2, the dbSetOrder() function behaves exactly like
     the Advantage function AX_SetTagOrder().  It is not necessary to
     convert your code if using CA-Clipper 5.2.

 Example

     // Old way
     USE old VIA "DBFNTX"               // Open OLD.DBF File
     SET INDEX TO this, that, onemore   // Open Indexes

     dbSetOrder( 2 )                    // Select THAT.NTX
     ? IndexOrd()                       // Returns: 2

     //New way (assume TEST.CDX contains same tag names as above)
     USE test VIA "DBFCDXAX"            // Open TEST.DBF & TEST.CDX

     AX_SetTagOrder( 2 )                // Select THAT tag
     ? AX_TagName()                     // Returns: "THAT"
     ? AX_TagOrder()                    // Returns: 2


See Also: SET TAGORDER AX_SetTagNo() SET TAG AX_SetTag()

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