Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- SIx Driver RDD v3.00 - Reference Guide - <b>sx_keyno():</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
  Sx_KeyNo():

  Syntax:  Sx_KeyNo( [nOrder] | [cTagName [, cIndexName ]] [, lLockIndex] )

           nOrder     = Position of tag in list of tag orders.
           cTagName   = Name of tag.
           cIndexName = Name of index file which contains cTagName.
           lLockIndex = Logical value indicating index locking mode to be
                        used.  The default is .T. (no index locking).

  Returns:   <numeric> Number representing the logical location of
                  the current key in the current or specified index.

  Description:    This function examines the current index and returns
                  the logical record position of the current key in the
                  current or specified index or tag.  If the current or
                  specified index is a compound index (.CDX/.NSX) then the
                  active tag is used.

                  This function allows you to determine the depth of the
                  current index key in an index or tag, regardless of
                  whether the index is conditional or not.

                  This function respects any active index SCOPE and will
                  return the relative key position within the active scope
                  condition.

    NOTE:  Keep in mind that this function determines its return value
           strictly based on KEYS in the index file.  If you have marked
           records in your database for deletion, the index KEY for those
           records will STILL be in the index, and will STILL be counted.
           If you do not want Sx_KeyNo() or Sx_KeyCount() to count keys
           for records marked as deleted, you must create the index as a
           CONDITIONAL index FOR !DELETED().  For example:

               INDEX ON last TAG last FOR !Deleted()

    NOTE:  This function is NOT supported under SIXNTX.

  Example:

    #include "SIXCDX.CH"

    // Assuming that TEST.PRG has 1000 records
    USE test VIA "SIXCDX"          // Open TEST.DBF
    INDEX ON last TAG last         // Create LAST tag
    GO TOP                         // Go to the top of the index
    ? RecNo()                      // Display record number (who knows?)
    ? Sx_KeyNo()                   // Display key number (1)
    GO BOTTOM                      // Go to the top of the index
    ? RecNo()                      // Display record number (who knows?)
    ? Sx_KeyNo()                   // Display key number (1000)


  NOTE:  See the SCRLLBAR.PRG program for an example of using Sx_KeyNo()
         to create a scroll-bar display on the side of a browse window.


See Also: Sx_KeyCount() Sx_KeyAdd() Sx_KeyDrop() Sx_KeyData()

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