sx_RecNo

<< Click to Display Table of Contents >>

Navigation:  Apollo API Listing >

sx_RecNo

VB Declaration

Declare Function sx_RecNo Lib "Apollo9.dll" () As Long

C Declaration

ULONG FAR PASCAL sx_RecNo (VOID);

Description

Extracts the current physical record number.

Return Value

The record number. The physical record number is always used as an input parameter to sx_Go.

VB Example

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 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

C Example

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);

}

See Also

sx_OrderRecNo