TURN

PURPOSE:  The TURN equated command is designed to give the user the ability to LOCK one or more items in a DBL while performing a modification to the application the items represent.  Only the user who turned the lock on can modify the items.  This is accomplished by storing the users name in the DBL item.  Setting the LOCK on an item does not prevent the use of the item.  The LOCK only prevents others from modifying the item.

The contents of the system field @MODIFY_LOCK effect how unlocking is accomplished.  If @MODIFY_LOCK contains "YES" then each item is unlocked when it is modified and SAVEd.  If @MODIFY_LOCK contains anything else then the item will not be released until the user executes the TURN command to release the item.

SYNTAX

FORM 1:

TURN /MODIFY LOCK {ON;OFF} [IN DBL DBL.name] FOR item.type item.list

TURN /MODIFY LOCK {ON;OFF}

sets or unsets modify locks.  MODIFY is not required in the command.  May use LOCK, LOCKS and LOCKED.

IN DBL DBL.name

used to TURN MODIFY LOCKs in a DBL other than the current one.

item.type

valid item types are:  CF, SD, CM, DI, ID, PM, SI, CS, GS

item.list

single item name or multiple names separated by a comma.

FORM 2:

TURN LOCKS OFF [IN DBL DBL.name] [FOR ALL /ITEMS/]

TURN /MODIFY/ LOCKS OFF

unsets modify lock.  MODIFY is not required in the command.  May use LOCK, LOCKS and LOCKED

IN DBL DBL.name

used to TURN MODIFY LOCKs in a DBL other than the current one.

[FOR ALL /ITEMS/]

used to turn LOCKs off all item in the DBL irrespective of the user who locked the items.  If this clause is not specified then only the items locked by the user executing the TURN command will be unlocked.

FORM 3:

TURN /MODIFY/ LOCKS OFF SET BY user.name [IN DBL DBL.name] 

[FOR item.type item.list]

TURN /MODIFY/ LOCKS OFF

unsets modify lock.  MODIFY is not required in the command.  May use LOCK, LOCKS and LOCKED

SET BY user.name

used to override the name of the user executing the command.

IN DBL DBL.name

used to TURN MODIFY LOCKs in a DBL other than the current one.

FOR item.type

valid item types are:  CF, SD, CM, DI, ID, PM, SI, CS, GS

item.list

single item name or multiple names separated by a comma.

NOTES:  Items can also be locked automatically by setting "YES" to the system field @MODIFY_LOCK.  It will lock the item when the MODIFY command is executed and unlock it when a SAVE or STOP subcommand is executed.

EXAMPLE

In the following example, a modify LOCK will be assigned to a PM.

*TURN LOCK ON FOR PM TEST1

when another user attempts to modify the PM, the following occurs:

*MODIFY PM TEST1
MODIFY PM TEST1
this item is locked by another user and cannot be modified.