Classic Computer Magazine Archive COMPUTE! ISSUE 34 / MARCH 1983 / PAGE 165

Atari Menu Printer

Dana Noonan

Alphabetize and then automatically print a listing of programs on an Atari disk. It also provides an easy way to quickly update file listings.

Ever wondered just what was on a particular disk? Tried using a disk library program, but gave up because of the time involved in updating your library listing? Do you want a simple way to know what is on all your Atari disks?

For the last six months most of my disks have included some sort of menu program I saw in a computer magazine. These menu programs list all the files on the disk as they appear in the DOS disk directory. Most allow you to call DOS or to run programs by typing a number. While useful, I have never been completely satisfied with any of them.

What annoyed me most was that the programs were listed in a disorganized manner. Since I use word processing and spread-sheet programs extensively, I usually back up each file, using the same title but a different extender. I may have files called CHAPTER2.S12, CHAPTER2.S15, and CHAPTER2.BAC on the same disk. The DOS directory is organized by the order in which disk space is used, and similar file names can be over-looked easily.

Lines 100 to 860 are a simple alphabetized menu program. If your disk contains more than 32 programs, the menu program gives you a choice of viewing either the first or the last 32 programs on a disk. You can call DOS or run any BASIC program which has been previously SAVEd from the menu.

Although I was pleased with the improved appearance of the menu listing, I was still not satisfied with it. What was really needed was a program that would automatically create a printed listing of the programs on a disk (lines 900-1130). I wanted a program that could print either a 4″ × 1½″ pressure-sensitive label or a slip of paper that I could insert in the disk jacket.

The label could be applied to closed disks – those that were full of programs that I intended to keep indefinitely. I use the simplified Menu (lines 100 to 860) on these disks. For disks that are only partially full or are still being changed, I use a 4-5/8;″ × 5-1/8;″ paper label which slips into the disk jacket.

This is ideal for using with a word processor or spread-sheet. After each session in which you add to, or delete anything from, a disk, simply run the Menu Printer and insert the new listing into the jacket. The list as programmed here is to be printed on an Epson MX-80 printer with Graphtrax, but could be adapted to any printer with a condensed font.

Unless a disk already boots another program automatically, you could use the program in the article, "Automate Your Atari," in the January 1983 COMPUTE!.

After formatting a disk, use a pattern disk to duplicate (DOS option J) DOS.SYS, DUP.SYS, MENU and the AUTORUN.SYS.

You could even keep a copy of Menu Printer and DOS.SYS (but not DUP.SYS) on word processor and spread-sheet data disks. Although these programs take about ten percent of the disk space, the ease of generating a hard copy listing of working files is worth it. One possible disadvantage of auto-booting this program: it takes about 18 seconds to bring up the menu, while booting DOS takes only about nine seconds.

The program has significantly improved my ability to find the programs I need quickly and easily. The alphabetized printed list of disk files is particularly useful for finding data files for commercial word processing, data base, and spreadsheet programs.

Menu Printer Listing

Lines Function
100-150 Dimension the strings. Line 150 names the disk.
200-290 Read the disk directory and set up the string to be sorted.
300-370 The actual string sort.
400-630 Display the program names and enable you to run a program, call DOS, or print a menu.
620-630 Let you switch backand forth between the first and last 32 programs.
700-860 Run the program, if it is a SAVEd BASIC file.
900-1050 Print an alphabetized list of the programs on the disk. Line 920 provides blank fields if they are needed. If you want toadd more information, such as a date or your name, to the title line, delete the final ? #4;CHR$(13) from line 980 and add line 985 ? #4;"My Name";: ? #4;CHR$(13). If a pressure-sensitive label is needed, change line 1030 to IF PG < 7 THEN GOTO 1020. This works best if the disk contains fewer than 24 programs.
1100-1130 Trap any disk or printer errors. After you check the disk or printer, the program continues.
100 REM SET-UP
110 REM SAVE "D : MENU
120 OPEN #2, 4, 0, "K :" : GRAPHICS 0 : POKE 752, 1 : POKE 559, 0
130 DIM A$(900) , P$ (15) , S$(13) , B$(15), BL$(40) , F$ (15) , L$ (13) , N$ (30) , Z$(16)
        : Z$ = "AND PRESS RETURN"
140 A$(1) = " " : A$(900) = " " : A$(2) = A$ : P$ = ""
        : B$ = " " : BL$ = " " : BL$ (40) = BL$ : BL$(2) = BL$ : F$ = ""
150 N$ = "JOURNAL AND WORKING FILES"
200 REM READ DIRECTORY
210 TRAP 1130 : OPEN #1, 6, 0, "D : *.*" : TRAP 40000
220 FOR I = 0 TO 14 : B$ = " " : NEXT I
230 INPUT #1, P$
240 IF P$(5, 8) = "FREE" THEN GOTO 290
250 P$ = P$(3, 13)
260 REC = REC + 1 : CC = LEN(P$)
270 IF CC = 0 THEN T = REC : CLOSE #1 : GOTO 300
280 A$(REC * 13 - 12, REC * 13 - 12 + CC) = P$ : GOTO 230
290 F$ = P$ : CC = 0 : GOTO 270
300 REM SORT
310 T = INT(T/3) + 1 : FOR L1 = 1 TO REC - T : FOR L2 = L1 TO 1 STEP -T
320 IF A$ (L2 * 13 - 12, L2 * 13) < = A$((L2 + T) * 13 - 12, (L2 + T) * 13) THEN 360
330 S$ = A$(L2 * 13 - 12, L2 * 13) : A$(L2 * 13 - 12, L2 * 13) = A$((L2 + T) * 13 - 12, (L2 + T) * 13)
340 A$((L2 + T) * 13 - 12, (L2 + T) * 13) = S$
350 NEXT L2
360 NEXT L1
370 IF T > 1 THEN 310
400 REM PREVIEW DATA
420 P = 1 : X = 1 : TEC = REC - 32 : IF TEC < = 0 THEN 440
430 IF TEC > 0 THEN N = 16 : REC = 32
440 N = INT(REC/2)
450 POKE 559, 34 : GRAPHICS 0 : POKE 752, 1 : POKE 82, 2
460 L = LEN(N$) : LL = (38 - L)/2 : POSITION LL, 0 : ? N$
470 POSITION 12, 2 : ? F$ ; "S"
480 POSITION 2, 4 : FOR MX = X TO N : S$ = ""
490 IF MX < = 9 THEN S$ = CHR$(32)
500 ? S$ ; MX ;") " ; : ? A$(MX * 13 - 12, MX * 13) : NEXT MX
510 POKE 84, 4 : FOR MX = N + 1 TO REC : S$ = ""
520 POKE 85, 20 : IF MX < = 9 THEN S$ = CHR$(32)
530 ? S$ ; MX ;" " ; : ? A$(MX * 13 - 12, MX * 13) : NEXT MX
540 POSITION 2, 21 : ? "1) RUN {7 SPACES}2) DOS {7 SPACES}3) PRINT"
550 IF TEC > 0 THEN POSITION 13, 22 : ? "4) NEXT PAGE"
560 POSITION 13, 23 : ? "CHOOSE OPTION";
570 GET #2, R : IF R < 49 OR R > 52 THEN 560
580 A = VAL(CHR$(R))
590 IF A = 1 THEN 700
600 IF A = 2 THEN DOS
610 IF A = 3 THEN 900
620 IF A = 4 AND P = 1 THEN ? CHR$ (125) : REC = REC + TEC : X = 33 : N = INT(TEC/2) + 32 :
        P = 2 : GOTO 460
630 IF A = 4 AND P = 2 THEN P = 1 : GOTO 460
700 REM RUN PROGRAM
710 TRAP 710 : POSITION 2, 21 : ? " {6 SPACES} INPUT PROGRAM YOU WANT {6 SPACES}" :
        POSITION 11, 22 : ? Z$ ; : INPUT X : TRAP 40000
720 IF X <> INT(X) THEN 710
730 IF X = 0 THEN 710
740 L$ = A$ (X * 13 - 12, X * 13)
750 IF L$(9, 9) = " " THEN L$ = L$(1, 8) : GOTO 770
760 FOR X = 12 TO 10 STEP -1 : L$(X, X) = L$ (X - 1, X - 1) : NEXT X : L$ (9, 9) = "."
770 S$ = "D:" : FOR I = 1 TO LEN(L$) : IF L$(I, I) = " " THEN 790
780 S$(LEN(S$) + 1) = L$(I, I)
790 NEXT I
800 POKE 752, 1 : POSITION 6, 22 : ? "{4 SPACES}LOADING " ; L$
810 TRAP 820 : RUN S$ : TRAP 40000
820 POSITION 6, 22 : ? "{3 SPACES}CANNOT RUN " ; S$ : TRAP 40000 : FOR WAIT = 1 TO 900 : NEXT WAIT
830 POSITION 2, 19 : FOR J = 20 TO 23
840 ? BL$(1, 38);
850 NEXT J
860 POSITION 2, 19 : GOTO 540
900 REM PRINT
910 GOTO 940
920 REC = REC + 1 : P$ = "{11 SPACES}"
930 CC = LEN(P$) : A$(REC * 13 - 12, REC * 13 - 12 + CC) = P$
940 IF REC/4 <> INT (REC/4) THEN 920
950 TRAP 1110 : OPEN $4, 0, 8, "P:" : TRAP 40000
960 ? #4 ; CHR$(27) ; CHR$(68) ; CHR$(3) ; CHR$(23) ; CHR$(43) ; CHR$(63) ; CHR$(0);
970 ? #4 ; CHR$(15) ; "----------------------------------------------------------------
        ------------------------------------------"
980 ? #4 ; CHR$(13) ; CHR$(9) ; N$ ; CHR$(9) ; F$ ; "S" ; : ? #4 ; CHR$(13)
990 PG = 1
1000 N = INT(REC/4) : FOR Q = 1 TO N : FOR MX = Q TO REC STEP N
1010 ? #4 ; CHR$(9) ; A$(MX * 13 - 12, MX * 13) ; : NEXT MX : ? #4 ; CHR$(9) : PG= PG + 1 : NEXT Q
1020 ? #4 : PG = PG + 1
1030 IF PG < = 27 THEN GOTO 1020
1040 ? #4; "--------------------------------------------------------------------------------
        --------------------------"
1050 CLOSE #4 : GOTO 540
1100 REM ERROR TRAPS
1110 CLOSE #4 : ? "{CLEAR}" : POKE 82, 11 : POKE 752, 1 : POSITION 13, 10 : ?
        "CHECK PRINTER" : ? "{2 DOWN}" ; Z$ : GET #2, R
1120 POKE 82, 2 : GOTO 400
1130 ? CHR$(125) : POKE 82, 11 : POKE 752, 1 : POSITION 14, 10 : ? "CHECK DISK" :
        ? "{2 DOWN}" ; Z$ : GET #2, R : GOTO 20