Navigation:  Reference > Functions >

PackDBF()

Print this Topic Previous pageReturn to chapter overviewNext page

 

PACK_DBF(1)

 

PURPOSE

This function will remove all deleted records a DBF (CodeBase) file.  It will also remove any records from the DBT (memo) file if the master record is no longer there.  This has the effect of reducing the size of the DBF and DBT files.

 

PARTS

 

1 f/c/eRequired - The file_number/handle of the file to use.

 

RETURN TYPE - L

If the file is packed properly the function will return .T., if not it will return .F.

 

COMMENTS

NOTE:  This will only work on CodeBase type files.  It will return .False. if you attempt to use this function in connection with a Btrieve file.

 

NOTE:  The file used in this function must have been previously opened using the OPENV command.  It is strongly recommended that you use the "D" lock type when you open the file to deny access to this file to any other user while you are in the packing process.

 

NOTE: THIS FUNCTION AUTOMATICALLY REINDEXES THE FILE AT THE SAME TIME.  THERE IS NO NEED TO PACK AND REINDEX.

 

EXAMPLE

define packfile type L

define bkarcust_hndl type I

btnpack.click:

packfile = PACK_DBF(bkarcust_hndl)

if packfile

  msg 'File was packed'

else

msg ' File was not packed'

endif

ret

 

SEE ALSO

REINDEX_DBF()

 

 


Page url: http://www.cassoftware.com/tas/manual/packdbf().htm