80-Bus News

  

September–October 1983, Volume 2, Issue 5

Page 62 of 67

The program goes like this:

All very easy stuff, using two parallel one dimensional arrays, one, N$(n) as the key, the second P$(n) as the data. Notice that I chose to use a string array for P$(n) even though it only contains numbers. This is because it needn’t only contain numbers, for instance I always write phone numbers, 01-402-6822, which certainly isn’t numeric (that isn’t my number by the way, so don’t try it.) Or P$(n) could contain an address as well as the phone number, or recipes (short ones as string length is restricted to 255 characters), or, well, you name it.

THE HARDER BIT

Having looked at both types of commonly used database, the random access and the sequential (and the sequential free field type) and having looked at the way in which the data would be split up into fields within the records in the file (neat summary that, databases consist of fields in a record in a file). It is plainly obvious that both types of database have snags when it comes to access. The sequential database can usually only be looked at in a sequential manner, which means that if the file is of any length, then access time to any record will depend on the position of that record within the file. If it happens to be at the end of the file it just takes a long time to get at, tuff!! The problem with the random access file is not so much the access time, it only takes a few milliseconds to move the disk head to the correct track/​sector position, but how the devil do you know which is the correct track/​sector position.


Page 62 of 67