60500 REM BASIC PROGRAM LISTER 60510 REM -- written by Gary Foster 74076,237 60520 REM ================== 60530 REM The purpose of this program is to print a BASIC program 60535 REM that is stored on disk in listed format. 60540 REM 60550 REM This program has several features not offered by the 60555 REM LIST"P: command. 60560 REM 60570 REM <1> the top of each page will contain the program name, the 60575 REM version number, date of the listing, and page number. 60580 REM 60590 REM <2> all printing is indented 10 spaces from the left margin 60595 REM to allow punching for notebooks 60600 REM 60610 REM <3> this program will print six blank lines at the top and 60615 REM bottom of each page 60620 REM (in other words, it will skip over page perforations). 60630 REM 60640 REM <4> this program will indent continuations of lines that 60645 REM are longer than your printer can accommodate. 60650 REM If you have a wide carriage printer, set variable LL in 60655 REM line 60730 to 132. 60660 REM 60670 REM This program requires Microsoft Basic to execute ---- 60675 REM but it will print Atari Basic, Microsoft Basic, and other 60680 REM programs with line numbers 60700 REM ================== 60710 CLS:PRINT "PROGRAM LISTER":PRINT:PRINT 60720 INPUT "Enter today's date: ";DATE$:PRINT 60730 LC=0:PN%=1:LP=54:LM=10:LL=80 60740 PRINT"Enter file name (D?:NAME.EXT)" 60750 INPUT A$:GOSUB 61020 60760 IF F%=0 THEN PRINT:PRINT"** END OF FILE **":GOTO 61070 ELSE F$=A$ 60770 INPUT "Enter program version no: ";V$ 60780 SP%=1:OPEN #1, A$ INPUT:OPEN #3,"P:" OUTPUT 60785 PRINT #3,CHR$(12):INPUT "Is paper properly positioned? ";X$ 60790 IF X$<>"Y" THEN 60785 60800 GOSUB 60900 60810 IF EOF(1) THEN 60890 60820 LINE INPUT #1,A$ 60830 IF A$="" THEN 60820 60840 L=INSTR(A$,CHR$(32)) 60850 LN$=LEFT$(A$,L):LN=VAL(LN$) 60860 GOSUB 60940 60870 IF LC>=LP THEN GOSUB 61010:GOTO 60800 60880 GOTO 60810 60890 CLOSE #1:GOSUB 61010:PRINT:GOTO 61070 60900 IF EOF(1) THEN RETURN 60910 PRINT #3,TAB(LM) "Program Name - ";F$;" Version: ";V$;TAB(LL-20) DATE$;TAB(LL-7) "Page "; 60920 PRINT #3, USING "##";PN%:PN%=PN%+1 60930 FOR I=1 TO SP%*2:PRINT #3, " ":NEXT I:LC=1+SP%*2:RETURN 60940 PRINT #3, TAB(LM); 60950 PRINT #3, USING "##### ";LN; 60960 J=LEN(STR$(LN)):A$=RIGHT$(A$,LEN(A$)-J) 60970 K=LL-LM-6 60980 FOR I=1 TO LEN(A$) STEP K 60990 PRINT #3,TAB(LM+6) MID$(A$,I,K):LC=LC+1 61000 NEXT I:RETURN 61010 FOR I=1 TO 66-LC:PRINT #3," ":NEXT I:LC=0:RETURN 61020 REM See if file exists 61030 I=1:F%=1:ON ERROR GOTO 61040:OPEN #1, A$ INPUT:CLOSE #1:ON ERROR GOTO 0:RETURN 61040 PRINT:RESUME 61050 61050 PRINT "** FILE NOT FOUND **":PRINT 61060 LINE INPUT "Enter new file name: ";A$:GOTO 61020 61070 END