Release file/record locks set by the current user
ALL releases all current locks in all work areas. If not specified, only the lock in the current work area is released.
UNLOCK is a network command that releases file or record locks set by the current user. Use it when you want to release the current lock without setting a new lock. Both FLOCK() and RLOCK() release the current lock before setting a new one.
After an UNLOCK, an update to a shared database file and associated index and memo files becomes visible to DOS and other applications, but is not guaranteed to appear on disk until you perform a COMMIT or close the file.
Refer to the “Network Programming” chapter in the Programming and Utilities Guide for more information on the principles of locking and update visibility.
. SET RELATION: UNLOCK does not automatically release a record lock along a RELATION chain unless you UNLOCK ALL.
. This example attempts an update operation that requires a record lock. If the RLOCK() is successful, the record is updated with a user-defined function and the RLOCK() is released with UNLOCK: USE Sales INDEX Salesman SHARED NEW IF RLOCK() UpdateRecord() UNLOCK ELSE ? "Record update failed" BREAK ENDIF
DBUNLOCK(), DBUNLOCKALL(), FLOCK(), RLOCK(), SET RELATION