<TBL>.PACK()

Syntax

<TBL>.PACK()

Description

You pack a table if there have been design changes (changes to the data dictionary) or you have deleted records that you want to permanently remove. The <TBL>.PACK() method packs a table, referenced by the object pointer, <TBL>. Packing a table reclaims the space taken up by deleted records and rebuilds indexes. The <TBL>.PACK() method does not remove records only marked for deletion.

The Pack operation requires exclusive access to a table. If exclusive read/write access cannot be obtained, the <TBL>.PACK() method causes an error.

Use the <TBL>.RECORDS_DELETED() method to determine if a table has any deleted records and therefore needs to be packed.

Supported By

Alpha Five Version 5 and Above

Example

Pack the current table, but first confirm the operation.

dim tbl as P

tbl = table.current()

'Compute the Message Type code

code = UI_YES_NO + UI_SECOND_BUTTON_DEFAULT + UI_QUESTION_SYMBOL

response = ui_msg_box("Pack Table","Are you sure? ", code)

if response = UI_YES_SELECTED then 'User selected Yes

    tbl.pack()

end if

See Also

Table Functions and Methods