<< Click to Display Table of Contents >> Navigation: Apollo API Listing > sx_Zap |
Declare Sub sx_Zap Lib "Apollo9.dll"
VOID FAR PASCAL sx_Zap (VOID);
Remove all records from the table. If a memo file is attached to the table, it is cleared as well. All indexes attached to the work area are also reset to empty.
After sx_Zap, only the data structure remains and sx_Eof will return True.
Note: The table must be opened in Exclusive mode in order to perform an sx_Zap operation.
' Delete all records and reset index files
If Not sx_Use("c:\vb\sxuser\cust.dbf", "cust", EXCLUSIVE, SDENTX)
MsgBox "File not available. Try again later."
Else
iRet = sx_IndexOpen("c:\vb\sxuser\sxcust1.ntx")
iRet = sx_IndexOpen("c:\vb\sxuser\sxcust2.ntx")
iRet = sx_IndexOpen("c:\vb\sxuser\sxcust3.ntx")
sx_Zap
sx_Close
End If
void CNamesForm::OnButtonZap()
{
if (!sx_Use("c:\\vb\\cust.dbf", "cust", EXCLUSIVE, SDENTX))
AfxMessageBox((LPCSTR) "File not available. Try again later.");
else
{
sx_IndexOpen("c:\\vb\\sxcust1.ntx");
sx_IndexOpen("c:\\vb\\sxcust2.ntx");
sx_IndexOpen("c:\\vb\\sxcust3.ntx");
sx_Zap();
sx_Close();
}
}