|★ APPLICATIONS ★ DISQUE ★ Disc Catalogue ★|
|Disc Library|Computing With the Amstrad)||Applications Disque|
HAVE you ever been in the infuriating position of knowing that somewhere in your disc collection is a vital file or program, and then catalogued a dozen discs before you found it? Disc Library will put an end to all that by using the disc directories to produce a catalogue of filenames in alphabetical order.
Now you can look up a filename and find out the disc, side, and user group in which it is stored. You can even print out the catalogue and keep it handy for quick reference.
Type in the program and weed out your typing mistakes with the help of the checksum utility from the June 1987 issue. Although Disc Library isn't a big program it uses most of the free memory in your machine for storing data, and overall it's a very tight fit. If you have roms fitted you may find you have to switch them off for the program to run properly. In most cases Disc Library will warn you if there isn't enough room, but if you suffer from odd crashes, try turning off all roms except number seven - the disc ROM.
When you run the program you will see a menu, and the nine options are summarised in Table I. To avoid confusion I'll refer to the physical disc directory as a directory, and the file of names produced by this program as the catalogue.
Table I: Menu options Option one allows you to load a previously saved catalogue and will prompt you for a filename. The first time you run the program you won't have a catalogue on disc, so to begin building one - or add to the one in memory - select option two and insert the disc to be read.
You will have to choose a disc name up to eight characters long. Then you'll be asked which side is being read - A or B. Finally, you can opt to read user 0 only, or 0-15 inclusive.
The disc directories will then appear on screen and the program will copy them into its database. As the CPC464 doesn't have a COPYCHR$ command there's some machine code which does the job, though on the CPC6128/664 it duplicates the existing facility.
Disc Library can't find SYS files, but you can edit the catalogue file stored on disc in a word processor. Remember that the last row must be an empty record consisting of 25 spaces.
When adding a directory, the old filenames on the same disc side are first erased from the catalogue. In this way you can easily perform an update after changing the contents of a disc. If you have given two files on different discs the same name don't worry, they'll both appear. Don't forget to save the updated catalogue with option five before you exit from the program.
After the filenames have been added to the database you will be returned to the menu. Select option three to see the names in alphabetical order on the screen. In the list you will see the filename, disc name, disc side and user number.
The fourth item on the menu will send the catalogue to the printer and caters for continuous or single sheet stationery. The variable cs in line 1960 should be set to 0 for single sheet or left as 1 for continuous. The records are printed either three items across the page using draft, or five items in condensed text.
The sixth option allows you to erase from the catalogue the filenames on one disc side. This can be user 0 only, or users 0-15. If you have a large number of files and are working with users 1-15, this option is very slow.
Item seven allows you to erase certain file types or pick one out and erase all others. This is useful for extracting all files ending in, say, .BAS, or erasing any .BAK files.
Every item in the catalogue is 25 characters long. Between 990 to 1064 entries can be stored, and the program will not allow you to read in another directory if there isn't room for a full disc side of new entries.
If you run out of room you'll have to work with more than one file, but most people won't find this necessary. We used Disc Library to produce a catalogue of our master discs containing all the programs published in the last three years, and that took up less than half the available space.
Should multiple files be necessary, option eight allows you to clear the current catalogue from memory to enable you to start off a second one. This has the same effect as picking out a non-existant file type, but is a lot quicker.
Finally, option nine will hunt through the catalogue for a specific filename. Type in the first part of the name and the extension separately. If you miss out the extension by pressing Return/Enter, the routine will try to find a match with as many characters you have given it. In this way you can look for all filenames starting with a particular character or set of characters. Note that ? and * wildcards are not supported.
The original version of the program used a string array for the filenames, one element for each. This worked perfectly on the CPC6128 but caused problems on the CPC464. With large files, whenever the array was accessed the micro lost itself in huge amounts of garbage collection, causing the program to pause for long periods.
To make Disc Library compatible "with all models it was decided to go for a RAM file system. Each record is poked directly into memory with an RSX |WRITEREC, and read out again with |READREC. Another bar command - |RECCOPV - copies one record into another. The end result works on all models and a little faster than the original CPC6128 version.