Unlock

Unlock allows to unlock either a symbol or all the tables previously locked by the development partner.

Syntax

 (1) Unlock CLASS_LIST(2) Unlock SYMBOL_LIST

Examples

 # Let's free the symbol SYMBOL that was previously lockedUnlock SYMBOL# Let's free a record previously lockedReadlock [TEST]CLE2(1) = date$If [S]fstat[TEST]ZONE += 100Rewrite [TEST]Unlock [TEST]Endif# Let's unlock a computed symbolSYMBOL = "MYLOCK"Lock =SYMBOL With lockwait = 0...Unlock =SYMBOL

Description

Unlock unlocks:

Unlock does not update the fstat variable.

Unlock works on tables only if no transaction was created by Trbegin. In a transaction, Unlock does not work (the Commit or Rollback will release the locks).

Comments

A lock on a table is automatically released when the table is closed. This means that a Close, as well as a LogicClose done on a LocalFile will implicitly unlock the table and its lines.

In a transaction, the updated lines are automatically locked and unlocked upon transaction end (by Commit or Rollback). The symbols are not concerned by this automatic release of locks.

If a symbol lock is performed within a transaction, it is part of the transaction. If a Rollback occurs, the lock is reverted as all the updates done in the database.

You can lock symbols in another folder and even a server than the current one. In this case, Unlock frees all the locks created on the corresponding folder by the user.

Associated errors

Error codeDescription
7The class does not exist (table not opened).
10Argument has a bad data type.

See also

Lock, Readlock, For, Close, Trbegin, Commit, Rollback, adxtlk.