Difference between revisions of "LOCKR"

From Recital Documentation Wiki
Jump to: navigation, search
 
Line 1: Line 1:
=LOCKR=
 
 
 
 
==Class==
 
==Class==
 
Manual Locking
 
Manual Locking
Line 30: Line 27:
 
seek "ROMEO"
 
seek "ROMEO"
 
if found()
 
if found()
  lockr
+
    lockr
  replace price with price*1.2
+
    replace price with price * 1.2
  unlock
+
    unlock
 
endif
 
endif
 
</code>
 
</code>
Line 41: Line 38:
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:Commands]]
 
[[Category:Commands]]
 +
[[Category:Manual Locking]]
 +
[[Category:Manual Locking Commands]]

Revision as of 08:43, 2 June 2009

Class

Manual Locking


Purpose

Lock a record for exclusive use


Syntax

LOCKR


See Also

CLEAR LOCKS, CLOSE DATABASES, DISPLAY STATUS, FLOCK(), LOCKF, RLOCK(), UNLOCK, USE, SET EXCLUSIVE


Description

The LOCKR command provides the facility to lock a record in the active table for exclusive use. LOCKR is similar to the RLOCK() function except that LOCKR suspends program execution until the lock is granted. In order to prepare a table for locking, SET EXCLUSIVE OFF must be in effect when you USE the table.

The LOCKR command works in conjunction with the UNLOCK command. Whenever you issue CLOSE DATABASES, UNLOCK, USE, QUIT or CLEAR LOCKS, then any active locks will be removed. You can see any active locks using the DISPLAY STATUS command. This command is not normally needed as the Recital/4GL performs automatic file and record locking.


Example

set exclusive off
use patrons index events, names
seek "ROMEO"
if found()
    lockr
    replace price with price * 1.2
    unlock
endif


Products

Recital Database Server, Recital Mirage Server, Recital Terminal Developer