Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Advantage CA-Clipper Guide v6.11 - ax_unlock() http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 AX_UnLock()
 Unlock one or more records in a shared table
------------------------------------------------------------------------------

 Syntax

     AX_UnLock( [<nRecNo> | <aRecArray>] ) -> logical

     <nRecNo> Record number of a single record to unlock.

     <aRecArray>  Array of record numbers of records to unlock.

 Returns

     Returns TRUE (.T.) if the record is succesfully unlocked.  Returns
     FALSE (.F.) if not. If .F. is returned, the error code returned from
     the AX_Error() function will give you more information as to why the
     operation failed.

 Description

     Unlocks one or more records in a shared table.

     If no parameters are passed, all locked records are unlocked.  If the
     table is FLOCKed, the FLOCK is released.

     UNLOCK and UNLOCK ALL commands unlock all records locked by the
     current user as well as releasing a FLOCK.  UNLOCK is equivalent to
     AX_UnLock() with no parameters.

     Note: AX_UnLock() is illegal if performed within a transaction.
     If AX_UnLock() is called while within a transaction, a runtime error
     will occur.

 Example

     LOCAL aRec := {5, 20, 57, 100, 324}    // Array of records to lock
     LOCAL nCount

     USE test SHARED VIA "DBFNTXAX"         // Open TEST.DBF
     AX_RLock( aRec )                       // Lock all five records

     //...( Do some stuff with those five records )...

     // Make sure they are all locked
     aRec := AX_GetLocks()                  // Get array of locked records
     FOR nCount := 1 TO Len( aRec )         // Cycle through array
        ? aRec[ nCount ]                    // displaying each record number
     NEXT

     AX_UnLock( 57 )                        // Unlock just record number 57
     AX_RLock( 500 )                        // Lock record 500
     AX_RLock( {75, 80, 90} )               // Lock records 75, 80, and 90
     AX_UnLock( {5, 100, 324} )             // Unlock records 5, 100, and
                                            // 324
     AX_UnLock()                            // Unlock all locked records


See Also: AX_GetLocks() AX_IsLocked() AX_RLock()

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