Show/Hide Toolbars

XSharp

NoteThis command is defined in a header file and will be preprocessed by the X# preprocessor to a function call. If you disable the standard header (-nostddefs) files then this command will not be available. If you tell the compiler to use a different standard header file (-stddef ) then this command may also be not available

Purpose

Remove all records marked for deletion from the current database file, rebuild all active orders, and recover all physical space occupied by the deleted records. Note that this will not affect memo files. Unused space in memo files can only be recovered by using COPY.

Syntax

PACK  [[IN|ALIAS] <workarea>]

Arguments

 

IN|ALIAS <workarea>Specifies the work area for which the operation must be performed

Description

PACK is functionally equivalent to DBPack().  

 

Warning! PACK does not create backup files.  You may want to make a backup of the file (using COPY FILE, for example) before issuing this command; otherwise, you will not be able to recover deleted records.

Examples

The following shows the result of a simple PACK:

 

USE sales NEW
? LastRec()         // Result:  84
 
DELETE RECORD 4
PACK
? LastRec()         // Result:  83

Assembly

XSharp.RT.DLL

See Also

DbPack(), DELETE, Deleted(), RECALL, REINDEX, SetDeleted() , SetExclusive(), ZAP