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

  Syntax:   Sx_ROXLock()

  Returns:  Logical .T. if index lock was successful, .F. if not.

  Description:  Turns Read-Only Index Locking on for the currently active
                index.  By locking the index prior to successive record
                pointer movement actions (SKIPs, SEEKs, etc.), you will
                notice a signifigant speed increase.  This function has no
                effect in a non-shared mode.

                With this Read-Only index lock set:

                  . All other network stations doing non-update operations
                    (SKIP, SEEK, GO TOP, GO BOTTOM) will behave normally.

                  . Any other network station attempting to update the index
                    will fail to get a lock until this station releases the
                    lock.  The other station will retry indefinitely to get
                    a lock, unless you have set a timeout value with the
                    Sx_LockRetry() function.

    NOTE:  This function is NOT supported under SIXNTX.

  Example:

    #include "SIXCDX.CH"

    LOCAL nSecs := 0

    SET EXCLUSIVE OFF              // Make sure we're in SHARED mode

    RDDSetDefault("SIXCDX")        // Select the SIXCDX Driver
    CLEAR                          // Clear the screen
    USE test                       // Open a table with SIXCDX
    INDEX ON last TO last          // Create an IDX index
    CLOSE ALL                      // Close everything and reopen it
    USE test INDEX test            //   to unlock the newly-created index

    dbGoTop()                      // Make sure we're at the top
    nSecs := Seconds()             // Save the start time
    ? "Without ROXLock...: "       // Display an informational message
    DO WHILE !Eof()                // Skip through the entire database
      dbSkip()
    ENDDO
    ?? AllTrim( Str( Seconds()-nSecs )) + " Seconds"  // Display total time

    dbGoTop()                      // Make sure we're at the top
    Sx_ROXLock()                   // Set a Read-Only lock on LAST.IDX
    nSecs := Seconds()             // Save the start time
    ? "With ROXLock......: "       // Display an informational message
    DO WHILE !Eof()                // Skip through the entire database
      dbSkip()
    ENDDO
    ?? AllTrim( Str( Seconds()-nSecs )) + " Seconds"  // Display total time
    Sx_ROXUnLock()                 // Unlock the index



See Also: Sx_ROXUnLock() Sx_IsROXLock() Sx_IsMyROX() Sx_RLock()

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