master directory/disk manager Scott Maxwell Commodore 64 6246 Ohm Ct., San Diego, CA 92122 Master Directory DM This program is to my knowledge, the quickest, most efficient program available for organizing software. I actually wrote this program so a friend of mine could organize his vast collection of software. Then I could find out what he had that I wanted. Since it was being written for him to use, I had to make it fast as well as powerful. This program is a BASIC/machine language hybrid. Everything that was too slow in BASIC has been converted to machine language. Basically, MASTER DIRECTORY takes directories from disks and stores them in memory where they may be edited, sorted, printed, and saved. It allows sorting by filename and by disk number. MASTER DIRECTORY allows editing of disk name, disk ID, and filename. It also allows for deletion of files or entire disks from the master list as well as updating of disks. It can handle about 2000- 3000 filenames and 256 disks in each menu file, but multiple menu files are allowable. The functions become practically self-explanatory as you use them. There are ten basic functions. These are: 1) Read Master File - Will read previously saved file 2) Save Master File - Will save file from memory 3) Enter New Disk - Read new directory into memory 4) Print File - Prints all or part of file to disk or printer 5) Sort File - Sorts by filename of disk number 6) Delete File Name - Deletes file name or range of names 7) Change File Name - Allows changing of file names 8) Delete Disk - Allows deletion of files-list of a certain disk 9) Change Disk Name - Allow changing of disk name and ID 0) Quit - Exits DISK MANAGER Typing a 'q' returns from any function. 1) READ MASTER FILE- This will read any previously saved menu file from the disk with a quick machine language routine. Many people only have one directory file, therefore, if you just hit <return>, it will default to 'MENU'. If you have a dual disk drive and wish to specify the drive, you must put quotes around the string, i.e. "1:GAMES". Otherwise, you will get an extra ignored error. 2) SAVE MASTER FILE- This function will save your current file from memory onto disk. Hitting <return> will automatically erase the old 'MENU' file and write the current file in memory as the new 'MENU' file. If you wish to replace an old file with the current file in memory you can type "@:name" but you must put quotes around it to avoid an extra ignored error. This will actually scratch the old file first, and then save the new file (so if you are worried about using the @ sign, in this program anyway, it is completely safe). 3) ENTER NEW DISK - This function is the one that actually reads a directory into memory. Machine language routines are used for reading the directory, printing the directory, and compressing the data. When you hit '3', the program immediately reads the current disk. NOTE: The desired disk must be in the drive before '3' is hit. The entire directory is listed on the screen and you are then told where the directory will be put in the master list and is asked if you want to add this directory to the master list. A <return> will default to yes. If you don't want to add this, simply type the letter 'n' followed by <return>. You are then asked if you would like to change the name of the disk. This is very helpful if the name on the label is not the same as the name in the directory. A <return> defaults to the current name, but if a new name is entered, a new ID is then allowed as well. Some directory programs won't allow for to disks to be entered that have the same ID number. This program does not care about ID numbers. They are merely there for the user to see. As a matter of fact, the way that the data is referenced in MASTER DIRECTORY is very simple. The first file is file zero, the next is file one, etc. When a sort is done, the new first program becomes number zero, etc. When files are deleted from the list, the list is automatically renumbered. The disks are referenced the same way. The first disk is number zero, the next is number one, etc. The one big difference is that the disk numbers never change. Once a disk has been entered, it keeps the same number until it is deleted. Therefore, you can put the disk number on your disk and keep them in numerical order. Then, when you look on your master list to find a program, you can find the correct disk very quickly. If a disk is deleted, the space remains open until another disk is entered. Example: Four disks are entered. Three filenames are deleted from disk two and the list automatically renumbers itself. The list is then sorted by filename. Each filename now has a new number. Then, you realize that disk three is not current, and you therefore delete that disk. The program automatically renumbers the file numbers, but not the disk numbers. In your file you have disks one, two, and four. You then enter the current disk three and it is automatically put in the first open disk number, three. You now have disks one, two, three, and four again. 4) PRINT FILE- This function prints all or part of your master file to your screen or printer. When you hit '4' the program first asks if you want to go to the screen or printer. If you hit <return> it will default to the screen. It then asks you what the first and last file numbers you want to see are. These default to the beginning and ending of your file if you hit only <return>. The output will be in the following format: file# blocks "filename" type disk number There is also a second type of output. If you hit shifted '4' (or shifted '6' or '7' for that matter) it will print in the following format. file# blocks "filename" type disk number:disk name If you print to the printer, the program will simply list until it is finished and then return to the main menu. If, however, you print to the screen, there is a bit more involved. First of all, the listing will stop after printing a full screen. It wait until a key is pressed and then continue until it has finished another screen. When it has printed the whole listing, it will automatically start over at the specified starting line and keep listing. It will not stop listing until a 'q' is pressed at the bottom of a page. A 'q' returns from any function. A fast forward and reverse are also built in. Every time you hit the <f1> key, the listing moves back twenty filenames and everytime you hit <f7>, it moves forward twenty filenames. 5) SORT FILE: When you hit '5' you are asked if you want to sort by disk or by whole. If you sort by disk, it will sort the filenames in each disk independently. Sorting by the whole file puts the whole list in alphabetically order by filename. Hitting <return> defaults to whole. A machine language shell/metzner sort is used and the sort usually takes under three seconds. 6) DELETE FILE NAME- This function works very much like the PRINT FILE function. It asks you the first and last file numbers to look at. NOTE: This is for listing purposes only. It does not delete these. Also, shifted '6' will give the secondary printing format. It then prints the file to the screen just like the PRINT function, except it stop at the bottom of each page with a blinking cursor and asks you which files you want to delete. If you hit <return> it will show you the next page. A 'q' quits the function and renumbers the file. If you wish to delete a file, simply type its file number and hit return. You can delete a whole range of files by type the first file number followed by a hyphen ('-') and the last number. For instance 12-17 will delete files 12 thru 17. Note also that the fast forward (f7) and reverse (f1) function keys work. 7) CHANGE FILE NAME- This works exactly like the delete file name function except that you can not specify a range of file numbers to change ( 12-17 ) and when you type the number of the file whose name you wish to change, it then asks for the new name. Otherwise, it is identical. This function was created to take care of programs like INFOCOM games which are all called 'GAME'. 8) DELETE DISK- This function simply lists the disk names one page at a time, waiting for a return which lists the next page, a 'q' which quits the function, or a disk number which deletes the disk name from the list as well as all filenames contained on that disk. 9) CHANGE DISK NAME- This function is identical to the delete disk function, except it allows you to change the disk name and ID. 0) QUIT Obviously this function exits from MASTER DIRECTORY. Note: It does not save the file. That must be done with the SAVE MASTER FILE function. In writing this, I have tried to make it as short as possible to allow for as many files as possible, while at the same time making it as powerful as possible. Some people have asked about a search feature. This can be done now by sorting and listing with the fast forward and reverse keys. Other functions such as a search have not been overlooked; simply decided against because of memory constraints. Finally, in working with this, I have had some problems with terrible garbage collections (or perhaps something worse). Since this program uses two large arrays, under certain conditions, the two arrays eat each other. This is a bug in your Commodore BASIC. I think I have pinned this down so that it only happens occasionally when you use the CHANGE DISK NAME function. I recommend, therefore that you change the disk name only when you first enter the disk. If you need to change a disk name again, save your file first.
Amiga7878