Classic Computer Magazine Archive ANTIC VOL. 5, NO. 4 / AUGUST 1986


File Master

No more disk disorganization


This useful database for disk directories sorts files alphabetically, by disk number, file type, file name extender, or number of sectors in the file. The BASIC program works on all 8-bit Atari computers with at least 32K memory and a disk drive.

Many Atari owners face this common problem, trying to find a specific program among dozens of disks containing hundreds of programs. After countless hours of fumbling around shoeboxes full of disks, I decided to solve the problem once and for all. The result is File Master, a program which sorts files alphabetically or by disk number, file type, file name exteder, or number of sectors in the file.

Type in Listing 1, FILEMSTR.BAS, check it with TYPO II, and SAVE a copy before you RUN it. In line 2630, the 800 can be changed to another number, depending on the number of files you expect to index.

Never fall victim to
disorganized disks

File Master first shows a brief title and then the main menu. The choices are similar to those in Broderbund's Print Shop. Select a function using the up-arrow and down-arrow. (You don't need to hold down the [CONTROL] key.) Press [RETURN] to begin the function you selected. Most of the program is menu-driven and has self-explanatory onscreen prompts.

On the main menu, the following options are available:

Add Records
Display Indexes On Screen
Print Indexes In Memory
Sort Indexes In Memory
Save Indexes To Disk
Load Indexes From Disk
Delete Index Disk File
Delete Index From Memory
Clear Memory
Exit Program
Display Current Directory
Change Drive Number

Records may be added at any time. The Add Records selection gives you a prompt for disk name and number and then asks if you want to print labels for the disk. You can also choose from a list of one-letter headings to identify each file as a utility, game, etc. You can change these headings to suit your own needs.

Choose the Print Indexes selection to print a current list of indexes in memory to either the screen or the printer. The Sort sub-menu works like the main menu; use the up-arrow and down-arrow keys to select an option, and start it by pressing [RETURN]. The Save and load options will prompt you for a file extension of three characters or less.

Delete Index File erases a previously saved index and prompts you for a file extension. Delete Index From Memory erases one disk directory from the rest of the indexes. Actual deletion won't happen until the file is saved back to the disk.

Clear Memory should be used carefully. It permanently erases all indexes which have not been saved to disk. The program asks you to verify this choice as an added precaution.

Sorts files
alphabetically, by disk,
type, extender or

To see what files are on the disk currently in the drive, choose the Display Current Directory option. And finally, the Change Drive selection switches you to another disk drive.

File Master will work on any Atari with at least 32K RAM. If your Atari has more memory, the program is smart enough to use the extra RAM for sorting more records. However File Master cannot access the extra 64K of RAM in the Atari 130XE model.

The unsorted data is kept in AREA$ and is DIMensioned according to the amount of free memory in your Atari. This routine is in lines 2625-2630.

To speed things up, the sorting routines show up early in the program (lines 60-130). The screen also turns off to make the sort go faster and you are told approximately how long the sort will take. For the sake of simplicity, I purposely left out any machine language sorting routines. I think readers can benefit by seeing how a sort is accomplished in BASIC.

For the most part, I have left the program open so you are free to learn from it and experiment with changes. Have fun tinkering with File Master; and never fall victim to disorganized disks again.

Jason Worley is 15 and attends Washington High School in Tulsa, Oklahoma. He has written many programs in BASIC and ACTION! with his Atari 800 during the past four years.

Listing 1: FILEMSTR.BAS Download