sx_Locked

<< Click to Display Table of Contents >>

Navigation:  Apollo API Listing >

sx_Locked

VB Declaration

Declare Function sx_Locked Lib "Apollo9.dll"

(ByVal lRecNum As Long)

As Integer

C Declaration

BOOL FAR PASCAL sx_Locked(LONG lRecNum);

Description

Determines the lock status of a record or a file.

Parameters

lRecNum: If you wish to determine whether a record is locked, pass the record number (from sx_RecNo) in lRecNum. If you want to find out if the file is locked, pass lRecNum as zero (0).

Return Value

True if the record or file is locked, and False if not.

VB Example

If sx_Locked(0) Then ' check lock status

MsgBox "File is in use. Try again later"

Else

If sx_Flock() Then

sx_Pack

sx_Unlock 0

Else

MsgBox "Lock failure"

End If

End If

C Example

if (sx_Locked(0))

AfxMessageBox((LPCSTR) "File is in use. Try again later.");

else

{

if (sx_Flock())

{

sx_Pack();

sx_Unlock(0L);

}

else

AfxMessageBox((LPCSTR) "Lock failure");

}

See Also

sx_Flock, sx_Rlock, sx_Unlock