BltDataSort


< Prev  TOC  Next >

TBLT_RETC TBLT_ENTRY BltDataSort(TBLT_FNCHAR *indexnamePtr,
                                 TBLT_FNCHAR *filenamePtr,
                                 TBLT_FNCHAR *newFilenamePtr,
                                 TBLT_DATACALLBACKPTR xCallBackPtr,
                                 TBLT_AUXPACK *apPtr);


 indexnamePtr   I:name of index file on which to base sort order
 filenamePtr    I:name of file to sort
 newFilenamePtr I:name of new file
 xCallBackPtr   I:function pointer to routine to callback, 0 if none
 apPtr          I:auxiliary pack

This routine re-orders the DBF file so that the data records are in key order of the index file specified.

If a file is normally accessed in key order, sorting the data file in that key order will make record access much more efficient.

After a successful sort, the original file may be deleted or archived and the new file can be renamed to that of the original.

The index and DBF files must be closed. The new file must not already exist.

The TBLT_DH.xCallBackPtr pointer is not used by the routine, but can be used to store the callback function pointer supplied to this routine. The source to this routine is in the optional optdata.c file.

apPtr is the pointer to an optional auxiliary pack. Set apPtr = 0 if there is no pack. This pack lets you override the internal operating system IFS calls for this handle, and set IFS options, such as 64-bit file offsets. See the supplemental documentation for details.

Return: Non-zero indicates an error, otherwise the database is now in the new file and ordered as the index file. The original file remain unchanged.




All content Copyright © 1999 Cornel Huth. All rights reserved.