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 - ax_clearorder() http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 AX_ClearOrder()
 Close a specified index
------------------------------------------------------------------------------

 Syntax

     AX_ClearOrder( [<nFileOrder>] ) -> logical

     <nFileOrder> A numeric value specifying the index file order
     position of the desired index to close.  The index file order position
     is based on the order in which the indexes are opened.

 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

     AX_ClearOrder() allows you to selectively close a single index without
     closing any other open indexes.  Any indexes in a greater order
     position will be moved up one order position.

     Note: AX_ClearOrder() is illegal if performed within a transaction.
     If AX_ClearOrder() is called while within a transaction, a runtime
     error will occur.

 Example

     LOCAL nX := 0
     USE test VIA "DBFCDXAX"             // Open TEST.DBF

     SET INDEX TO last, state, age, zip  // Open 4 indexes

     // Loop through index order displaying each one
     ? "Displaying indexes open in order:"
     ? "--------------------------------------"
     FOR nX := 1 TO AX_IndexCount()
        ? AllTrim( Str( nX ) ) + " " + AX_IndexName( nX )
     NEXT

     // 1 LAST.IDX
     // 2 STATE.IDX
     // 3 AGE.IDX
     // 4 ZIP.IDX

     // Close the second index (state.idx) only
     AX_ClearOrder( 2 )

     // Loop through index order displaying each one
     ? "Displaying indexes open in order:"
     ? "--------------------------------------"
     FOR nX := 1 TO AX_IndexCount()
        ? AllTrim( Str( nX ) ) + " " + AX_IndexName( nX )
     NEXT

     // 1 LAST.IDX
     // 2 AGE.IDX
     // 3 ZIP.IDX


See Also: AX_IndexCount() AX_IndexName()

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