Note | This command is defined in a header file and will be preprocessed by the X# preprocessor to a function call. If you disable the standard header (-nostddefs) files then this command will not be available. If you tell the compiler to use a different standard header file (-stddef ) then this command may also be not available |
Release all locks for a work area.
UNLOCK [RECORD nRecordNumber] [[IN|ALIAS] workarea] [ALL]
Arguments
RECORD nRecordNumber | Releases the record lock on record number nRecordNumber. Issuing UNLOCK RECORD nRecordNumber for a record in a table with a file lock releases the file lock. |
IN|ALIAS <workarea> | Specifies the work area for which the operation must be performed |
ALL | Releases all record and file locks in all work areas. If not specified, only the lock in the current work area is released. ALL cannot be combined with the RECORD or IN|ALIAS clause. |
UNLOCK is functionally equivalent to DBUnlock() and UNLOCK ALL is functionally equivalent to DBUnlockAll().
This example attempts an update operation that requires a record lock. If the RLock() is successful, the record is updated with a function and the RLock() is released with UNLOCK:
USE sales INDEX salesman SHARED NEW
IF RLock()
UpdateRecord()
UNLOCK
ELSE
? "Record update failed"
BREAK
ENDIF
XSharp.RT.DLL
DbRLock(), DbUnlock(), DbUnlockAll(), FLock(), RLock(), SetExclusive(), USE