★ APPLICATIONS ★ UTILITAIRES RSX/LIGNE DE COMMANDE ★ INSTANT ACCESS ★ |
INSTANT ACCESS (Computing with the Amstrad) | INSTANT ACCESS (Amstrad Action) | INSTANT ACCESS (Popular Computing Weekly) | INSTANT ACCESS (CPC Magazin) |
Extra commands speed production of DIY databases IAN SHARPE reviews a useful adjunct to Locomotive Basic INSTANT Access is designed to add random access disc -1 filing and other useful facilities to Locomotive Basic. It takes up about 10k of memory and provides 36 new RSX commands which fall into five main groups. These are summarised in Table I. Amsdos - the Amstrad Disc Operating System - behaves in a similar way to the cassette system. It maintains compatibility between disc and tape based machines but fails to exploit the full potential of disc filing. The main problem is that Amsdos only supports sequential files. Let's assume you had written a database which stored all your information on disc and you wanted to read a record part-way through. The only way to do it under Amsdos is to open the file and read all the records sequentially until you reach the one you want, just as if you were using cassette. It's like trying to look up Sharpe in a telephone directory by starting at the beginning and reading every name. This is a slow process and you would probably only write a database in Locomotive Basic if the data were small enough to fit in memory. You would then read all the data into ram, manipulate it there and write all it back to disc at the end of a session. This problem doesn't occur under CP/M, which lets you go straight to any part of a file and access it without having to load unwanted records. You can't alter the record as quickly as if it had been in memory, but the size of your database is only restricted by the amount of information you can get on a disc. This is one of the strengths of Mallard Basic supplied with the PCWs and available for the CPCs - at a price.
The file pointer, as you may guess from the name, is a variable that holds the position in the random access file where the next piece of data will be written to or read from. Included under the heading of general disc commands are those to set the default drive or user group, format particular tracks on a disc, load and save binary files without the need for a buffer, check for the existence of a file and dump a file to the screen. The format option will let you specify the sector numbers to be used in formatting. These are used by Amsdos and CP/M to decide (among other things) what type of format a disc is. If they come across numbers that don't fit in with one of the standard types such as data format, they will stop with an error message. The use of non-standard numbering on empty tracks of an otherwise normally formatted disc will prevent copying with Disckit but not one of the more sophisticated copiers. Sector editing commands allow you to write your own disc utilities in Basic. A sector can be loaded into a buffer, individual bytes peeked and poked and the amended sector written back to disc. These could form the basis of a directory editor or program to recover files from faulty discs. Seven commands are devoted to providing a greatly enhanced line editor which replaces INPUT and LINE INPUT from the keyboard. A string is filled with characters to the same length as the maximum number you want to allow in the input field and |EDIT,@string,x,y will present it for editing at the specified position. Spaces are shown as graphics characters which indicate the extent of allowable cursor movement. Control + R toggles between overtype and insert modes (why not Basic's Control + Tab?), the Clr and Del keys behave as expected and Control+W wipes the line. The input field wraps round at the right hand edge of the window, so if a window is defined to contain the same number of characters as the input string you can edit a box rather than a single line. For applications where it's desirable to move the cursor from field to field the character codes that exit the editor - maybe the ones generated by Control +cursor keys - can be specified. Another RSX returns the character that caused the editor to terminate, so it is easy to program these effects. The final group concentrates on error handling, mainly relevant to those generated by the utilities. A telephone directory program is included on the disc which serves as a good example of how to write a simple database using this package. The 31-page manual details each command and should not present any problems to an average Basic programmer. It also provides a line by line explanation of how the example program works. Instant Access is a genuinely useful package, ideally suited to writing databases and disc utilites in Basic. If you are on the lookout for a product to provide an alternative means of handling files I can certainly recommend this one, though I would quibble with the price. £29.95 seems a little over the odds for 10k of code, no matter how useful. CWTA |
|
|