<< Click to Display Table of Contents >> Navigation: Apollo API Listing > sx_Locked |
Declare Function sx_Locked Lib "Apollo9.dll"
(ByVal lRecNum As Long)
As Integer
BOOL FAR PASCAL sx_Locked(LONG lRecNum);
Determines the lock status of a record or a file.
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).
True if the record or file is locked, and False if not.
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
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");
}