A&B Computing


An Introduction To Random Access Filing On The BBC Micro

Author: Jonathan Evans
Publisher: C. J. Morris
Machine: BBC Model B

 
Published in A&B Computing 2.10

One of the more powerful aspects of the disc system is the ability to use random access files to store large databases whose size exceeds that of the computer's memory. Whilst this facility is exploited in various commercial programs, it is probably underutilised by Basic programmers due to lack of documentation in the User Guide and relative neglect in the specialist magazines. This combines book/software package aiming to educated programmers in the use of this facility in their own applications is consequently most welcome.

This package consists of a "book" (spiral bound A4) of some 120 pages together with a disc containing a suite of programs comprising two database systems, one for stock control and theother for personnel records. The programs are well presented (good screen design, error trapping, etc) but neither set of programs intended to be a complete working system, and there are omissions, e.g. options for hardcopy output.

The book itself starts very well with a clear explanation of the way in which records are laid down on the disc by use of PRINT - and the simplest explanation of the use of the feared PTR - for setting the pointer within a file that I have encountered. A good method for writing dummy files to reserve the space for your application is described, followed by rather too brief a reference to the use of the index files for quick searching and sorting of the master file.

The majority of the book consists of annotated listings of the programs contained on the disc. Whilst this is a sound method of teaching programming, I must criticise the author's use of brief, only single letter, variable names and the use of constants rather than variables to compute pointer positions in each application. In this respect I prefer the approach of Joe Telford's articles on the subject in Acorn User where mnemonic variable names are used and general purpose procedures are employed where possible.

To be fair, however, Morris is aiming his book at those wishing to customise their database programs and both his sample systems contain good examples of this (e.g. one can list items below re-order level in the stock control program). If you want a truly general purpose system you would be better off buying one of the commercial ROMs rather than trying to write your own in Basic. A useful bonus in Morris's book is a description of the use of disc overlays - another insufficiently publicised use of the disc system. The treatment of random access filing is by no means exhaustive and I felt particularly that the use of index files and the problems of sorting large random access fields were given inadequate coverage. I hope that the author will consider a revised edition to remedy the deficiencies mentioned, which could make this a really excellent buy.

In the absence of obvious alternatives, I would nevertheless recommend this package as it stands as a good introduction to the topic for competent Basic programmers wishing to develop the programming techniques required for writing customised database applications.

Jonathan Evans