Now that our supported xBase option is available as open source (and has been updated for other platforms) and also because we have been increasingly impressed by its performance, more features to support it have been indicated. CodeBase files are dBase IV compatible and that driver, included with Windows, can be used to query them using SQL (and which is something that we have previously successfully tested with our own SQL query program). We have therefore added a CBDELETED() function which is able to return the total number of deleted records in the DBF format that we support (CodeBase). This is important because the normal TRC() (total record count) function, unlike in a Btrieve/Pervasive/Actian ("Btrieve") file, includes deleted records, and so code that relies on that function could fail and/or work unexpectedly without a function that can be used to easily determine the actual number of "live" records in a DBF file. That function has now been tested and implemented and is already in active use in a number of our projects.
Because the maintain database program uses the TRC() function to show active records, we have now been able to enhance it to show the number of deleted records in the event that a DBF or (*.C* file) is opened in that option. This then allows the user to know what "net" active records are currently contained in the file, something that was not previously available.
Reindexing or "packing" the file can be used to permanently delete records in a DBF file. The DBF header record however is not decremented when a record is deleted. In order to determine the number of deleted records, the entire file does have to be internally scanned (which the CBDELETED() function automatically accomplishes based on the file handle passed to it) to determine the deleted record count. Use of this new function, therefore, involving DBF files with a large number of records has to be used with some level of care if used in an end user program. For this reason, in the maintain database enhancement, we make obtaining the deleted count an end user option rather than to automatically initiate it after the file is opened.
In the case of a Btrieve file, a deleted record takes up space but all of the fields are in essence blanked out (i.e. set to null values) and the active record count is maintained in the header record of the file. So TRC() returns the active record count.
In the course of adding the CBDELETED() function, we noticed that the OPEN_FILE_NAME() function was not returning the FILELOC path when a DBF file handle was passed to it, which it now does. Previously it was only returning the data file name without any path. When used with Btrieve files, it continues to return the fully qualified path.
And we also noticed that the GET_FILE_TYPE() function was internally being referenced as FILE_TYPE(), inconsistent with the documentation and the cmdtree.txt. This has been fixed.
We have also reviewed and made minor updates to both the Btrieve and CodeBase reindex utilities which had not been previously reviewed since 2012, and have also updated the globally change utility to make it more intuitive with respect to changes made to it in release 14.
Also of significance, the EXEC_RB() function which loads the report designer has been enhanced so that developers can optionally pass an RTM name as a parameter. This can include the full path, a relative path, or just the RTM name. If a file name is passed, the RTM is then automatically loaded without the user having to take any other action to open it for review/editing.
As we continue to work with and test these latest changes, some additional changes may be added before release 15 is officially published later this year.