<< Click to Display Table of Contents >> Navigation: Apollo API Listing > sx_Go |
Declare Sub sx_Go Lib "Apollo9.dll"
(ByVal lRecNum As Long)
VOID FAR PASCAL sx_Go
(LONG lRecNum);
Goes to a physical record that occupies the nth position in the table. sx_Go ignores filters, scopes, and sx_SetDeleted status.
lRecNum: The record number to go to. This is the physical location of the record in the table. An active order (i.e., index) has no effect on sx_Go.
If an order is active, the key pointer within that order is synchronized to the new record position.
Sub bDelete_Click ()
Dim lDelRec As Long
Dim lNewRec As Long
iRetVal = MsgBox("Confirm Delete", 52)
If iRetVal = 6 Then
lDelRec = sx_RecNo()
sx_Skip -1
' if there is no rec above, skip to next instead
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
LONG lRecNo;
BYTE caKey[12];
SHORT iCount = 0;
lstrcpy((LPSTR) caKey, (LPSTR) sx_GetString("key"));
lRecNo = sx_RecNo(); // save current pos
// count recs with same key
sx_Skip(1L);
while (TRUE)
{
if (sx_Eof())
break;
if (!lstrcmp((LPSTR) caKey, (LPSTR) sx_GetString("key"))
iCount++;
else
break;
sx_Skip(1L);
}
// restore position
sx_Go(lRecNo);