sx_Pack

<< Click to Display Table of Contents >>

Navigation:  Apollo API Listing >

sx_Pack

VB Declaration

Declare Sub sx_Pack Lib "Apollo9.dll" ()

C Declaration

VOID FAR PASCAL sx_Pack (VOID);

Description

Removes all records marked for deletion from a table. When records are deleted with sx_Delete, they are only logically deleted by flagging a hidden delete field. To physically remove the records from the table, it is necessary to pack the file.

When the table has been reorganized, all active orders are reindexed.

Memo files are packed as well and result memo file will contain memo data for the records remaining in the table. If packing FPT or SMT memos, the memo block size may changed from the default 64 by setting the new block size before packing with sx_SetMemoBlockSize. The packed memo file will use the new block size.

 

The progress of the pack operation may be visually monitored if a gauge hook has been set with sx_SetGaugeHook.

Note: The table must be opened in Exclusive mode in order to perform an sx_Pack operation.

VB Example

Sub ButtonPack_Click ()

If Not sx_Use("c:\vb\cust.dbf", "cust", EXCLUSIVE, SDENTX) Then

MsgBox "File in use. Try again later")

Else

iRet = sx_IndexOpen("c:\vb\sxcust1.ntx")

iRet = sx_IndexOpen("c:\vb\sxcust2.ntx")

iRet = sx_IndexOpen("c:\vb\sxcust3.ntx")

sx_SetGaugeHook GaugeBox.hWnd

GaugeFiles = 3

sx_Pack

sx_SetGaugeHook 0

sx_Close

End If

End Sub

C Example

if (!sx_Use("c:\\vb\\cust.dbf", "cust", EXCLUSIVE, SDENTX))

AfxMessageBox((LPCSTR) "File in use. Try again later.");

else

{

sx_IndexOpen("c:\\vb\\sxcust1.ntx");

sx_IndexOpen("c:\\vb\\sxcust2.ntx");

sx_IndexOpen("c:\\vb\\sxcust3.ntx");

sx_Pack();

sx_Close();

}

See Also

sx_Delete, sx_Deleted, sx_Recall, sx_Reindex, sx_SetGaugeHook, sx_Zap