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>multi-key, free-format indexes:</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
  Multi-Key, Free-Format Indexes:

  This is one step beyond the standard Roll-Your-Own (RYO) index feature.
  With the addition of the third parameter for the Sx_KeyAdd() function,
  you can add entries to a "template" key.  This key doesn't care where
  the values will be coming from (i.e., field name, function call, etc).
  All it cares about, is that the type of data matches the type that
  was used in creating the key.

  This information is provided by four special sx* functions to define the
  data type and, in the case of character values, the length.  These special
  functions are:

    sxChar( <nLen> ) -  Adds an empty character key of <nLen> length
    sxNum()          -  Adds an empty numeric key                   
    sxDate()         -  Adds an empty date key                      
    sxLog()          -  Adds an empty logical key                   


  The extended Sx_KeyAdd() syntax for adding keys to a free-format RYO
  Index is:

    Sx_KeyAdd( cTagName | nTagNum, cIndexName | nIndexOrd, [<xVal>] )

      where:  <xVal> is the key value to be used for this entry

  +--------------------------------------------------------------------------+
  | Example:                                                                 |
  |--------------------------------------------------------------------------|
  | USE foobar VIA "SIXNSX"                  // Open FOOBAR.DBF              |
  | INDEX ON sxChar(10) TAG bogus            // Create "BOGUS" Tag (*)       |
  | SET ORDER TO 0                           // Deselects Index TAG          |
  | GO TOP                                   // Make sure we're at the top   |
  | Sx_KeyAdd( "BOGUS", 1, left(LAST,10) )   // Adds a key for this rec      |
  | Sx_KeyAdd( "BOGUS", 1, left(FIRST,10) )  // Adds second key for same rec |
  |--------------------------------------------------------------------------|
  | (*) The BOGUS tag was created to use ANY 10 character string for the key |
  +--------------------------------------------------------------------------+


   WARNING:  If the Template RYO is a TAG within a .CDX/.NSX file, all keys
             within the TAG will be removed during a REINDEX.  If it's an IDX,
             it will not be touched at all by a REINDEX.  For this reason, it
             is suggested that you always use an .IDX file (under SIXCDX) or
             a single order .NSX file (under SIXNSX) for your Multi-Keyed
             indexing.

   NOTE:  See the MULTIKEY.PRG and HYPER.PRG programs for some practical
          examples of how Multi-Keyed, Free-Format indexes can be used.



See Also: Sx_KeyAdd() sxChar() sxNum() sxDate() sxLog()

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