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_findrec():</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
  Sx_FindRec():

  Syntax:  Sx_FindRec( <nRecno>, [<lCont>] )

           nRecno = the DBF record number to locate
           lCont  = .T. searches from the current record pointer, .F.
                    searches from the top of the DBF (Default)

  Returns: .T. is find is successful, .F. if not.  If no match is found,
           the record pointer is positioned at EOF.

  Description:  Locates a specific record number within the index file.
                This is mostly useful when searching for multiple key
                entries for the same record within a Roll-Your-Own (RYO)
                index.

    NOTE:  This function is NOT supported under SIXNTX.

  Example:

    #include "SIXCDX.CH"

    // Create a standard Roll-Your-Own (RYO) Index

    ? "Standard RYO Index:"
    ? "-------------------"
    USE test VIA "SIXCDX"                 // Open database
    INDEX ON last TO last EMPTY           // Create EMPTY index file
    GOTO 10                               // Select a record
    ? "Sx_KeyAdd() == "
    ?? Sx_KeyAdd()                        // Add a key for this record
    ? "DATA: " + Sx_KeyData()             // Displays key value for this rec
    ? "KEYS: " + Str( Sx_KeyCount(), 1 )  // Display number of keys in index
    ?

    // Create a Multi-Keyed, Free-Format RYO Index

    ? "Multi-Keyed RYO Index:"
    ? "----------------------"
    INDEX ON sxChar(12) TO phones        // Create empty index file
    GOTO 100                             // Select a record
    ? "Adding three key values for this record..."
    Sx_KeyAdd( 0,0,"213-555-1212" )      // Add one phone number for this rec
    Sx_KeyAdd( 0,0,"213-555-9999" )      // Add another to the same record
    Sx_KeyAdd( 0,0,"310-222-9876" )      // And yet another phone number!
    ? "KEYS: " + Str( Sx_KeyCount(), 1 ) // Display number of keys in index

    // Now display all phone numbers for this record
    IF Sx_FindRec( 100, .F. )            // Find first key for this record
      ? Sx_KeyData()                     // Display first phone number
      DO WHILE Sx_FindRec( 100, .T. )    // Find any other keys for this rec
        ? Sx_KeyData()                   // Display other phone numbers
      ENDDO
    ENDIF



See Also: Sx_KeyGoto() Sx_KeySkip() Sx_WildSeek() Sx_KeyData()

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