10 ! PROGRAM TO PRODUCE DOCUMENTATION FOR ALL BORGER'S PROGRAMS
100 DIM NA$[40]V(40),A$[140]V,F(40)
104 OPEN #3, "MANUAL.DIR/RO"
105 IF END #3 THEN 125
107 N=1
110 INPUT LINE #3, NA$(N)
111 K=POS(NA$(N),",R")
112 IF K>0 THEN LET F(N)=1 : NA$(N)=SBS$(NA$(N),1,K-1)
115 N=N+1
120 GOTO 110
125 CLOSE 3
126 N=N-1
127 PG=1
128 OPEN #4, "MANUAL.TMP/WR/LN:120"
129 OPEN #5, "CONTENTS.TMP/WR/LN:120"
130 PRINT #5 : PRINT #5 : PRINT #5, TAB(20); "UTILITY ROUTINES" : PRINT #5
131 FOR I=1 TO N
132 J=POS(NA$(I),"]") : J=J+1
133 IF F(I)=1 THEN 137 : ! SKIP INITIAL HEADER IF RUNOFF OUTPUT FILE
134 PRINT #4, CHR$(12)
136 PRINT #4, TAB(64);"PAGE ";FRMT$(PG,3);" ";SEG$(NA$(I),J,LEN(NA$(I)))
137 PRINT #5 : PRINT #5,TAB(20);SEG$(NA$(I),J,LEN(NA$(I)));TAB(40);FRMT$(PG,4)
138 IF F(I)=1 THEN LET PG=PG-1 : ! ADJUST PAGE COUNT
140 OPEN #3,NA$(I)+".DOC/RO/LN:120"
145 PRINT NA$(I)
150 IF END #3 THEN 300
160 INPUT LINE #3, A$
170 TP=POS(A$,CHR$(12))+1
172 IF TP>1 THEN  LET A$=SEG$(A$,TP,LEN(A$))
175 IF TP>1 THEN  LET PG=PG+1 : PRINT #4, CHR$(12);TAB(64);"PAGE ";FRMT$(PG,3);" ";SEG$(NA$(I),J,LEN(NA$(I)))
176 IF SBS$(NA$(I),1,1)=CHR$(14) THEN LET A$=SEG$(NA$(I),2,LEN(NA$(I))
177 IF F(I)=1 THEN 180
178 IF SBS$(A$,1,1)<>CHR$(9) THEN  LET A$=CHR$(9)+A$
180 PRINT #4, A$
190 GOTO 160
300 CLOSE 3
305 PG=PG+1
310 NEXT I
320 PRINT #5, CHR$(12)
330 CLOSE 
340 B=0 : CALL "SPAWNB"("PIP MANUAL.DOC=CONTENTS.TMP,MANUAL.TMP",B)
350 CALL "SPAWNB"("PIP *.TMP;*/DE",B)
355 CALL "SPAWNB"("PIP MANUAL.DOC/PU",B)
360 EXIT 
