Equinox Online Help - Language Reference - A to Z

Home

LockApplication

Applies to
SyntaxLockApplication
Action[Statement] Locks a multi-user application so that it cannot be accessed by another user.
ScopeUsable anywhere.
Notes

This statement causes a multi-user application to be opened in exclusive (single-user) mode. A locked application is exclusive to the locking user.

(This is evident in Jdisplay, under the statistics tab, next to the "Exclusive access" box, will be either a "yes" or "no" depending on the current setting)

You cannot lock an application if another user is already accessing it.

Once an application is locked, no one else will be allowed to access it until it is unlocked again by the locking user. Logging out of a locked application automatically unlocks it.

This statement is intended for use in "misson-critical" situations, such as chained operations that must run to completion before allowing user access.

The system workarea SysError is set to a non-zero value if an error occurs, otherwise zero.

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

The following example attempts to lock an application and broadcasts a general logout message if the lock fails.

LockApplication

if syserror then
DisplayMessage "Please Logout Now!", ToEveryone
| Locking user should ignore the message!