<< Click to Display Table of Contents >> Navigation: Apollo API Listing > sx_Skip |
Declare Sub sx_Skip Lib "Apollo9.dll"
(ByVal lNumRecs As Long)
VOID FAR PASCAL sx_Skip
(LONG lNumRecs);
Skips forwards or backwards a specified number of records. If an order is active (i.e., an index), the skip will be in logical sequence. If no order is active, the skip will be in physical sequence.
After the sx_Skip operation, always test for beginning of file (if lNumRecs is negative) or end of file (if lNumRecs is positive) with sx_Bof and sx_Eof respectively.
lNumRecs: The number of records to skip. If the number is positive, the skip is forward; if negative it is backwards.
Sub bDelete_Click ()
Dim lDelRec As Long
Dim lNewRec As Long
iRetVal = MsgBox("Confirm Delete", 52)
If iRetVal = 6 Then
' after the deletion we want to restart the table
' at the record in front of the deleted rec
lDelRec = sx_RecNo()
sx_Skip -1
If sx_Bof() Then
sx_Go lDelRec
sx_Skip 1
End If
lNewRec = sx_RecNo()
sx_Go lDelRec
sx_Delete
sx_Go lNewRec
End If
End Sub
void CNamesForm::OnButtonAdd()
{
LONG lSaveRec;
// re-enable database linkage
m_date->SetNumProperty("Unlink", FALSE);
// set switch on, setup append, and then edit
bAddMode = TRUE;
lSaveRec = sx_RecNo();
sx_GoBottom();
sx_Skip(1L);
OnButtonEdit();
// if user cancels edit, bAddMode will be FALSE
if (bAddMode)
sx_Append();
else
sx_Go(lSaveRec);
}