sx_Zap

<< Click to Display Table of Contents >>

Navigation:  Apollo API Listing >

sx_Zap

VB Declaration

Declare Sub sx_Zap Lib "Apollo9.dll"

C Declaration

VOID FAR PASCAL sx_Zap (VOID);

Description

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.

VB Example

' 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

C Example

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

}

}

See Also

sx_Delete, sx_Pack