<< Click to Display Table of Contents >> Navigation: Apollo API Listing > sx_Unlock |
Declare Sub sx_Unlock Lib "Apollo9.dll"
(ByVal lRecNum As Long)
VOID FAR PASCAL sx_Unlock
(LONG lRecNum);
Removes record and/or file locks from the current work area.
lRecNum: Indicates the specific record number to be unlocked. Passing a zero (0) unlocks all records and removes any file lock.
Note: This parameter is not currently used to indicate the specific record to be unlocked, but the sx_RecNo value should be used to insure future compatibility, where this support may be added.
If sx_Rlock(sx_RecNo()) Then
sx_Replace "name", R_CHAR, ByVal RTrim$((BoxName.Text))
sx_Commit
sx_Unlock sx_RecNo()
Else
MsgBox "Record lock failed"
End If
// save the record
void CNamesForm::OnButtonSave()
{
sx_Commit();
sx_Unlock(sx_RecNo());
if (!bAddMode)
m_sdebrowse->SetNumProperty("Action", BRW_ACT_REFRESHLINE);
// else refresh display on add
else
{
// reset add switch
bAddMode = FALSE;
// if scroll bar present, refresh all
if (m_sdebrowse->GetNumProperty("VBarDim"))
m_sdebrowse->SetNumProperty("Action", BRW_ACT_REFRESHALL);
// otherwise, gotop
else
m_sdebrowse->SetNumProperty("Action", BRW_ACT_GOTOP);
}
m_sdebrowse->SetFocus();
return;
}