Skip to content

UNLOCK

Unlock I/O Channel

This directive allows access to a file by all other users that was previously prohibited by a LOCK directive.

UNLOCK (channel [,ERR=line-ref|,ERC=error-code])
channel
is an integer in the range of 1 to 32764 that specifies the channel of an OPEN file. If omitted, 0 is the default.
line-ref
is the program line number or label to branch to if this directive produces an error.
error-code
is a programmer-defined error code. Valid values are positive or negative whole numbers.

This directive may only be used on a file that has been LOCKed. If an attempt is made to UNLOCK a file that is not currently LOCKed, an ERR=14 results.

A file that has been LOCKed cannot be accessed by another task until it is UNLOCKed by this directive or until a CLOSE, BEGIN, END or STOP directive is processed.

This directive does not close the file or release the assigned channel number.

UNLOCK (3)

removes the LOCK restriction from the file OPEN on channel 3.

UNLOCK (A, ERR=7999)

If A = 3, has the same effect as the previous example, but branches to statement 7999 if the directive produces an error condition.

LOCK directive

From the Thoroughbred Basic Language Reference, Volume III: R–Z, version 8.9.1. Open this page in the PDF