Skip to content

Get_Current_Lockcount

Obsolete

The get_current_lockcount command is obsolete. Use the DF_TRAN_COUNT attribute in its place.

See Also: Lock, Reread, Unlock

Purpose

To retrieve the number of locks currently in effect.

Syntax

Get_Current_Lockcount To {variable}

The value of variable would be 0 if no locks are in effect, 3 if three lock or reread commands have been executed with no unlocks in between.

What It Does

The Get_Current_Lockcount returns the number of locks that are currently in effect. A lock occurs when Reread or Lock commands execute. The following program shows how the number of locks can be retrieved.

Example

Integer iLockCount
Integer hInvtFile

// Retrieve the current directory.
Get_Current_Lockcount To iLockCount
Showln "First, there are " iLockCount " Locks."

Open "Invt" As hInvtFile
If (hInvtFile <> -1) Begin
    Showln "Locking Invt"
    Lock

    Get_Current_Lockcount To iLockCount
    Showln "Now, there is " iLockCount " Lock."

    Showln "Unlocking Invt"
    Unlock

    Get_Current_Lockcount To iLockCount
    Showln "At the end there are " iLockCount " Locks."
End