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_keydrop() http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 AX_KeyDrop()
 Manually remove a key from an index or tag
------------------------------------------------------------------------------

 Syntax

     AX_KeyDrop( [<cOrder>|<nPosition>], [<cCDXName>] ) -> logical

     <cOrder>  is a literal filename or character string specifying
     the name of the order. Using the order name is the preferred
     method since the position may be difficult to determine using
     multiple-order index files. If omitted or NIL, the controlling
     order is assumed.

     <nPosition>  is the number representing the position of an
     order in the order list. If omitted or NIL, the controlling
     order is assumed.

     <cCDXName>  is a literal filename or character string
     specifying the name of an index file, including an optional
     drive and directory (no extension should be specified). Use
     this argument with <cOrder> to remove ambiguity when there are
     two or more orders with the same name in different index files.

 Returns

     Returns a logical value of .T. if the key was successfully removed
     and .F. if an error occurred.  If an error occurred, AX_Error() will
     return information on why the function failed.

 Description

     This function is used to manually remove a key from an index. The
     current record in the current table is used to determine the entry
     to remove from the current or specified index. If the current or
     specified index is a compound index (.cdx) then the key is removed
     from the active tag, if no tag is specified.

     The new key is removed from the index or tag only if:

         The record pointer is positioned on a record (not EOF).
         The key exists in the index/tag.

     If no arguments are specified, then AX_KeyDrop() uses the current
     index file and current tag (if applicable). If only one argument is
     supplied, then <nOrder>/<cIndexName> is assumed. 0 (zero) can be
     used for either <nTagNo> or <nOrder> to specify the current tag or
     index, respectively.

     This function can be used in conjunction with AX_KeyAdd() to create
     your own customized indexes.

     Note: This function is supported only with the DBFCDXAX (.cdx)
     driver.

     Note: The record must be locked or the table opened exclusively
     or locked before performing this operation.

 Example

     // Need to include Advantage header file for INDEX ON ... CUSTOM
     #include "DBFCDXAX.CH"

     USE test VIA "DBFCDXAX"          // Open table
     INDEX ON last TO last CUSTOM     // Create CUSTOM index file
     GOTO 10                          // Select a record

     RLock()                          // The record must be locked before
                                      // adding or dropping a key
     AX_KeyAdd()                      // Add a key for this record
     ? AX_KeyCount()                  // 1

     AX_KeyDrop()                     // Delete this key from the index
     ? AX_KeyCount()                  // 0


See Also: AX_KeyAdd() INDEX

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