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

  Syntax:   Sx_IsROXLock()

  Returns:  .T. if a Read-Only lock has been set on the currently active
            index (using the Sx_ROXLock() function), .F. if not.

  Description:  This function is used to test if the currently active index
                already has a Read-Only lock active on it.

    NOTE:  This function is NOT supported under SIXNTX.

  Example:

    #include "SIXCDX.CH"

    LOCAL nSecs := 0, nCount := 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

    // Is Read-Only Index Locking Active?
    ? "ROX On? :" + iif( Sx_IsROXLock(), "Yes", "No" )   // Returns .F.

    nSecs := Seconds()             // Save the start time
    ? "Without ROXLock...: "       // Display an informational message
    FOR nCount := 1 TO 1000        // Loop 1000 times and
      dbSeek("BogusName")          //   SEEK a value that doesn't exist
    ENDDO
    ?? AllTrim( Str( Seconds()-nSecs )) + " Seconds"  // Display total time

    // Now let's put a read-only lock on the index file
    Sx_ROXLock()

    // Is Read-Only Index Locking Active?
    ? "ROX On? :" + iif( Sx_IsROXLock(), "Yes", "No" )   // Returns .T.

    nSecs := Seconds()             // Save the start time
    ? "With ROXLock......: "       // Display an informational message
    FOR nCount := 1 TO 1000        // Loop 1000 times and
      dbSeek("BogusName")          //   SEEK a value that doesn't exist
    ENDDO
    ?? AllTrim( Str( Seconds()-nSecs )) + " Seconds"  // Display total time
    Sx_ROXUnLock()                 // Unlock the index



See Also: Sx_ROXLock() Sx_ROXUnlock() Sx_IsMyROX() Sx_LockRetry()

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