Equinox Online Help - Language Reference - A to Z

Home

IsLockedByMe

Applies to
SyntaxIsLockedByMe (DataItem)
Action[Function] Checks if a specified data item is locked.
ScopeUsable anywhere.
Notes

Locking is a system which protects data integrity in a multi-user environment. When data is accessed by a user, it is locked so that no other user can edit or delete it. Once items such as tables are locked, no other user can alter them until they are unlocked again. You can use this function to determine whether a specific data item has been locked manually (using the Lock statement), by the current copy of Equinox. This means locked by the current view group, records in other view groups fail lock requests and return False to IsLockedByMe in the current view group. The argument, DataItem, is the name of the item and may be one of the following:

  • The Subtable keyword
  • A table name
  • A public workarea name

The function returns True if it is locked by the current user. If you want to determine if an item has been locked by another copy of Equinox, you must try to lock it yourself. If the item is locked already, the lock statement will fail.

CategoryLocking
See Also ApplicationState, Lock, LockApplication, LockRelated, LockRetry, RetryInterval1, RetryInterval2, Unlock, UnlockApplication
Example

This example increments the workarea NextAccountNo. The workarea is locked, if not locked already.

logical x

if IsLockedByMe(NextAccountNo) = false then
Lock NextAccountNo
x = true
else
x = false
end if

NextAccountNo += 1
if x then unlock NextAccountNo