<< Click to Display Table of Contents >> Navigation: Apollo API Listing > sx_Append |
Declare Sub sx_Append Lib "Apollo9.dll" ()
VOID FAR PASCAL sx_Append (VOID);
Append a record to the database using the current contents of the record buffer. Use sx_Append in situations where the user has the ability to cancel an intended record addition. If the record addition is canceled, a record does not have to be deleted from the database, as is the case with sx_AppendBlank.
To begin with an empty record buffer, force the record pointer to EOF as in the example below.
sx_Append immediately commits the new record to disk and updates all open indexes.
Sub bAdd_Click()
Dim lSaveRec As Long
iAddMode = True
lSaveRec = sx_RecNo()
sx_GoBottom ' force eof to clear rec buffer
sx_Skip 1
Editor.Show 1 ' if User cancels iAddmode will be false
If iAddMode Then
sx_Append
else
sx_Go lSaveRec
End If
End Sub
void CNamesForm::OnButtonAdd()
{
LONG lSaveRec;
// 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);
sx_AppendEx, sx_AppendBlank, sx_AppendBlankEx, sx_Commit, sx_PutRecord, sx_Replace