home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Nibble Magazine
/
nib24b.dsk
/
NAVIGATOR.3.bas
< prev
next >
Wrap
BASIC Source File
|
2023-02-26
|
17KB
|
448 lines
10 REM ********08/01/85********
20 REM * NAVIGATOR.3 *
30 REM * FLOW CHART PRINTER *
40 REM * BY LEE SWOBODA *
50 REM * COPYRIGHT (C) 1985 *
60 REM * BY MICROSPARC, INC *
70 REM * CONCORD, MA. 01742 *
80 REM ************************
90 REM
100 REM
110 D$ = CHR$(4)
120 HOME
130 EF = 1: ONERR GOTO 4430
140 PRINT D$"OPEN NAVIGATOR.TXT"
150 PRINT D$"READ NAVIGATOR.TXT"
160 INPUT NAME$,AUTH$,DT$,SELECT,COMMENTS,LMARGIN,RMARGIN,LPAGE,BMARGIN,D1,D2,SLOT
170 PRINT D$"CLOSE"
180 REM --------------
190 REM DEFAULT VALUES
200 REM --------------
210 DIM A$(40),B$(40),C$(40)
220 LCOUNT = 9: REM LINE COUNT
230 PAGE = 0: REM PAGE NUMBER
240 LNLGTH = RMARGIN -LMARGIN: REM LINE LENGTH
250 LPAGE = LPAGE -BMARGIN
260 LOOP = 0: REM LOOP FLAG
270 PRNT = 0: REM OUTPUT FLAG -> VIDEO SCREEN
280 INPT = 0: REM INPUT FLAG <- KEYBOARD
290 SLOT$ = "PR#" + STR$(SLOT)
300 U$ = CHR$(95): REM UNDERSCORE
310 S$ = CHR$(92): REM BACKSLASH
320 V$ = CHR$(124): REM VERTICAL LINE
330 FOR I = 1 TO 30
340 BLANK$ = BLANK$ + CHR$(32)
350 NEXT I
360 FOR I = 1 TO 42
370 UNDERLN$ = UNDERLN$ +U$
380 NEXT I
390 FLOW$ = V$
400 K = 1: REM SUB-LINE SUBSCRIPT
410 B$(1) = BLANK$ +FLOW$
420 REM -----
430 REM START
440 REM -----
450 IF SELECT = 2 THEN PRINT D$SLOT$: PRINT CHR$(9)"80N"
460 GOSUB 4340: REM PRINT HEADER
470 PRINT LEFT$(BLANK$,22) LEFT$(UNDERLN$,17)
480 PRINT LEFT$(BLANK$,21)V$ LEFT$(BLANK$,17)V$
490 PRINT LEFT$(BLANK$,21)V$" START "V$
500 PRINT LEFT$(BLANK$,21)V$ LEFT$(UNDERLN$,17)V$
510 PRINT BLANK$FLOW$
520 EF = 2: ONERR GOTO 3980
530 PRINT D$"OPEN EXX,D"D1
540 PRINT D$"READ EXX"
550 REM ------------
560 REM BUILD STRING
570 REM ------------
580 B$ = ""
590 GET A$
600 IF A$ = CHR$(13) THEN QFLAG = 0: GOTO 630
610 B$ = B$ +A$: IF LEN(B$) >249 THEN B$(1) = "<<< LISTED LINE TOO LONG FOR NAVIGATOR >>>": GOSUB 4470:K = 1:EF = 2: GOTO 3570
620 GOTO 590
630 EF = 0: PRINT CHR$(1);
640 B = VAL(B$)
650 IF B = 0 GOTO 590
660 A$ = STR$(B)
670 B = LEN(A$)
680 A$ = LEFT$(A$ +" ",6)
690 B$ = RIGHT$(B$, LEN(B$) -B -1)
700 IF LEFT$(B$,1) = " " THEN B$ = RIGHT$(B$, LEN(B$) -1): GOTO 700
710 B$ = A$ +B$
720 IF MID$ (B$,7,3) = "REM" OR MID$ (B$,7,4) = "DATA" GOTO 1600
730 REM ------------
740 REM FORMAT LINES
750 REM ------------
760 JJ = 1: REM STRING SUBSCRIPT
770 IF DOS = 1 THEN DOS = 0
780 KK = LEN(B$)
790 C$(1) = ""
800 FOR MM = 1 TO KK
810 A$ = MID$ (B$,MM,1)
820 IF A$ = CHR$(4) THEN DOS = 1
830 IF MID$ (A$(JJ),7,8) = "PRINT D$" OR MID$ (A$(JJ),7,14) = "PRINT CHR$ (4)" THEN DOS = 1
840 IF A$ <" " THEN A$ = "^" + CHR$( ASC(A$) +224): REM CONTROL CHARACTERS
850 IF A$ = CHR$(34) THEN QFLAG = NOT QFLAG: REM STRINGS
860 IF QFLAG AND A$ = " " THEN A$ = CHR$(126): REM CHANGE SPACE TO TILDE
870 IF QFLAG GOTO 980: REM DO NOT FORMAT STRINGS
880 IF A$ < >":" GOTO 910
890 IF MID$ (B$,MM -3,4) = "MEM:" GOTO 910
900 IF MID$ (B$,7,2) < >"IF" AND MID$ (C$(JJ),7,2) < >"IF" THEN JJ = JJ +1:C$(JJ) = " ":A$ = "": REM NEW LINE
910 IF MM <7 GOTO 980
920 IF A$ = " " AND RIGHT$(C$(JJ),1) = " " GOTO 990
930 IF A$ = " " AND RIGHT$(C$(JJ),1) = "(" GOTO 990
940 IF A$ = " " AND MID$ (B$,II +1,1) = "(" GOTO 990
950 IF A$ = "," THEN A$ = ", "
960 IF MID$ (B$,MM,8) = "PRINT D$" OR MID$ (B$,MM,15) = "PRINT CHR$ (4)" THEN DOS = 1
970 IF A$ = ";" THEN A$ = "; "
980 C$(JJ) = C$(JJ) +A$
990 NEXT MM
1000 REM ---
1010 REM DOS
1020 REM ---
1030 FOR II = 1 TO JJ
1040 B$ = C$(II)
1050 REM
1060 REM SCAN FOR CHANGES IN CONTROL
1070 REM
1080 IF DOS = 0 GOTO 1380
1090 L1 = LEN(B$)
1100 FOR I = 15 TO L1
1110 IF MID$ (B$,I,4) = "PR#0" THEN PRNT = 0:SHAPE = 2:FLAG = 1: GOTO 1860
1120 IF MID$ (B$,I,4) = SLOT$ THEN PRNT = 1:SHAPE = 2:FLAG = 3: GOTO 1860
1130 IF MID$ (B$,I,4) = "OPEN" THEN SHAPE = 2:FLAG = 4: GOTO 1860
1140 IF MID$ (B$,I,6) = "VERIFY" THEN SHAPE = 2:FLAG = 4: GOTO 1860
1150 IF MID$ (B$,I,6) = "APPEND" THEN SHAPE = 2:FLAG = 4:DOS = 2: GOTO 1860
1160 IF MID$ (B$,I,4) = "EXEC" THEN SHAPE = 2:FLAG = 5: GOTO 1860
1170 IF MID$ (B$,I,6) = "DELETE" THEN SHAPE = 2:FLAG = 4: GOTO 1860
1180 IF MID$ (B$,I,5) = "CLOSE" AND INPT = 6 THEN INPT = 0:SHAPE = 2:FLAG = 4:DOS = 1: GOTO 1860
1190 IF MID$ (B$,I,5) = "CLOSE" AND PRNT = 6 THEN PRNT = 0:SHAPE = 2:FLAG = 4:DOS = 1: GOTO 1860
1200 IF MID$ (B$,I,5) = "WRITE" THEN PRNT = 6:SHAPE = 2:FLAG = 4:DOS = 2: GOTO 1860
1210 IF MID$ (B$,I,4) = "READ" THEN INPT = 6:SHAPE = 2:FLAG = 5:DOS = 2: GOTO 1860
1220 IF MID$ (B$,I,5) = "BLOAD" THEN SHAPE = 2:FLAG = 4: GOTO 1860
1230 IF MID$ (B$,I,4) = "BRUN" THEN SHAPE = 2:FLAG = 4: GOTO 1860
1240 IF MID$ (B$,I,3) = "CAT" THEN SHAPE = 2:FLAG = 4: GOTO 1860
1250 IF MID$ (B$,I,7) = "CATALOG" THEN SHAPE = 2:FLAG = 4: GOTO 1860
1260 IF MID$ (B$,I,5) = "CHAIN" THEN SHAPE = 2:FLAG = 4: GOTO 1860
1270 IF MID$ (B$,I,6) = "CREATE" THEN SHAPE = 2:FLAG = 4: GOTO 1860
1280 IF MID$ (B$,I,5) = "FLUSH" THEN SHAPE = 2:FLAG = 4: GOTO 1860
1290 IF MID$ (B$,I,3) = "FRE" THEN SHAPE = 2:FLAG = 4: GOTO 1860
1300 IF MID$ (B$,I,4) = "LOCK" THEN SHAPE = 2:FLAG = 4: GOTO 1860
1310 IF MID$ (B$,I,6) = "PREFIX" THEN SHAPE = 2:FLAG = 4: GOTO 1860
1320 IF MID$ (B$,I,6) = "RENAME" THEN SHAPE = 2:FLAG = 4: GOTO 1860
1330 IF MID$ (B$,I,3) = "RUN" THEN SHAPE = 2:FLAG = 4: GOTO 1860
1340 IF MID$ (B$,I,4) = "SAVE" THEN SHAPE = 2:FLAG = 4: GOTO 1860
1350 IF MID$ (B$,I,5) = "STORE" THEN SHAPE = 2:FLAG = 4: GOTO 1860
1360 IF MID$ (B$,I,6) = "UNLOCK" THEN SHAPE = 2:FLAG = 4: GOTO 1860
1370 NEXT I
1380 REM ---------------
1390 REM DETERMINE SHAPE
1400 REM ---------------
1410 SHAPE = 1
1420 IF MID$ (B$,7,5) = "PRINT" THEN SHAPE = 2
1430 IF MID$ (B$,7,5) = "INPUT" THEN SHAPE = 2
1440 IF MID$ (B$,7,3) = "GET" THEN SHAPE = 2
1450 IF MID$ (B$,7,2) = "IF" THEN SHAPE = 3
1460 REM --------------
1470 REM DETERMINE FLAG
1480 REM --------------
1490 IF SHAPE < >2 GOTO 1560
1500 FLAG = 1
1510 IF MID$ (B$,7,5) = "PRINT" AND PRNT = 0 THEN FLAG = 1
1520 IF ( MID$ (B$,7,5) = "INPUT" OR MID$ (B$,7,3) = "GET") AND INPT = 0 THEN FLAG = 2
1530 IF MID$ (B$,7,5) = "PRINT" AND PRNT = 1 THEN FLAG = 3
1540 IF MID$ (B$,7,5) = "PRINT" AND PRNT = 6 THEN FLAG = 4
1550 IF ( MID$ (B$,7,5) = "INPUT" OR MID$ (B$,7,3) = "GET") AND INPT = 6 THEN FLAG = 5
1560 REM ----------------------------------
1570 REM HANDLE REMARKS AND DATA STATEMENTS
1580 REM ----------------------------------
1590 IF MID$ (B$,7,3) < >"REM" AND MID$ (B$,7,4) < >"DATA" GOTO 1710
1600 IF COMMENTS = 0 AND MID$ (B$,7,3) = "REM" GOTO 580
1610 B$ = B$ +" "
1620 L2 = 1
1630 L1 = LNLGTH -25
1640 IF LCOUNT +3 >(LPAGE) THEN GOSUB 4180
1650 IF MID$ (B$,L1,1) < >" " AND MID$ (B$,L1,1) < >"," THEN L1 = L1 -1: IF L1 >LNLGTH -35 GOTO 1650
1660 PRINT LEFT$(B$(K),8) LEFT$(B$,6) MID$ (B$(K),15,31)" " MID$ (B$,L2 +5,L1 -5):LCOUNT = LCOUNT +1
1670 B$ = " " + MID$ (B$,L1 +1, LEN(B$))
1680 IF LEN(B$) >LNLGTH -25 GOTO 1620
1690 PRINT LEFT$(B$(K),31) MID$ (B$,L2 +5,L1 -5):LCOUNT = LCOUNT +1
1700 GOTO 580
1710 REM -------------------
1720 REM HANDLE CONDITIONALS
1730 REM -------------------
1740 IF MID$ (B$,7,2) < >"IF" GOTO 1860
1750 L1 = LEN(B$)
1760 ARROW$ = "--->"
1770 FLOW = 0
1780 FOR I = 10 TO L1
1790 IF MID$ (B$,I,4) = "THEN" THEN FLOW = 1:L2 = I: IF MID$ (B$,I +5,5) = "GOSUB" THEN FLOW = 3:ARROW$ = "--->"
1800 IF MID$ (B$,I,4) = "GOTO" THEN FLOW = 2:L2 = I
1810 IF FLOW >0 THEN I = L1 +1
1820 NEXT I
1830 ARROW$ = ARROW$ + MID$ (B$,L2 -1,L1)
1840 B$ = LEFT$(B$,L2 -2)
1850 REM #11000
1860 REM ---------
1870 REM FORM TEXT
1880 REM ---------
1890 L2 = 29
1900 IF SHAPE = 2 THEN L2 = 23
1910 IF SHAPE = 3 THEN L2 = 27
1920 LNUM$ = LEFT$(B$,5)
1930 L1 = LEN(B$)
1940 J = 1
1950 FOR I = 7 TO L1 STEP L2
1960 A$(J) = MID$ (B$,I,L2 +1)
1970 A$(J) = LEFT$(A$(J) +BLANK$,L2)
1980 J = J +1
1990 NEXT I
2000 J = J -1
2010 IF L1 <L2 +5 THEN A$(1) = LEFT$( LEFT$(BLANK$,(L2 -L1 +6)/2) +A$(1) +BLANK$,L2)
2020 ON SHAPE GOTO 2030,2310,3030
2030 REM -------
2040 REM SHAPE 1
2050 REM -------
2060 B$(1) = LEFT$(BLANK$,14) +" " + LEFT$(UNDERLN$,15) +"V" + LEFT$(UNDERLN$,15) +" "
2070 IF FLOW$ = " " THEN B$(1) = LEFT$(B$(1),30) +U$ + MID$ (B$(1),32, LEN(B$(1))):FLOW$ = V$
2080 B$(2) = LEFT$(BLANK$,8) +LNUM$ +" " +V$ + LEFT$(BLANK$ +BLANK$,31) +V$
2090 FOR I = 1 TO J
2100 B$(I +2) = LEFT$(BLANK$,14) +V$ +" " +A$(I) +" " +V$
2110 NEXT I
2120 B$(J +3) = LEFT$(BLANK$,14) +V$ + LEFT$(UNDERLN$,31) +V$
2130 L = INT(J/2) +3
2140 IF MID$ (B$,7,4) = "GOTO" THEN B$(L) = B$(L) +"--->" + MID$ (B$,11, LEN(B$)):FLOW$ = " "
2150 IF MID$ (B$,7,5) = "GOSUB" THEN B$(L) = B$(L) +"--->" + MID$ (B$,12, LEN(B$))
2160 IF MID$ (B$,7,2) < >"ON" GOTO 2270
2170 FOR AA = 10 TO LEN(B$)
2180 IF MID$ (B$,AA,4) = "GOTO" GOTO 2210
2190 NEXT AA
2200 IF AA = > LEN(B$) GOTO 2220
2210 B$(L) = B$(L) +"--->" + MID$ (B$,AA +4, LEN(B$)):FLOW$ = " ": GOTO 2260
2220 FOR AA = 10 TO LEN(B$)
2230 IF MID$ (B$,AA,5) = "GOSUB" GOTO 2250
2240 NEXT AA
2250 B$(L) = B$(L) +"--->" + MID$ (B$,AA +5, LEN(B$)):FLOW$ = "V"
2260 IF LEN(B$(L)) >LNLGTH +(LMARGIN) THEN B$(L +1) = B$(L +1) +" " + MID$ (B$(L),LNLGTH +LMARGIN, LEN(B$(L))):B$(L) = LEFT$(B$(L),LNLGTH +LMARGIN)
2270 IF MID$ (B$,7,6) = "RETURN" OR MID$ (B$,7,3) = "END" THEN FLOW$ = " "
2280 B$(J +4) = BLANK$ +FLOW$
2290 K = J +4
2300 GOTO 3490
2310 REM -------
2320 REM SHAPE 2
2330 REM -------
2340 FOR I = 1 TO J
2350 D$(I) = A$(I)
2360 NEXT I
2370 IF J >2 GOTO 2410
2380 J = J +1
2390 D$(J) = LEFT$(BLANK$,L2)
2400 GOTO 2370
2410 L1 = 19
2420 B$(J +3) = LEFT$(BLANK$,L1 -1) +S$ + LEFT$(UNDERLN$,23) +"/"
2430 B1$ = " "
2440 B1 = 2
2450 FOR K = J TO 1 STEP -1
2460 B$(K +2) = LEFT$(BLANK$,L1 -B1) +S$ +B1$ +D$(K) +B1$ +"/"
2470 B1$ = B1$ +" "
2480 B1 = B1 +1
2490 NEXT K
2500 B$(2) = LEFT$(BLANK$,L1 -6 -B1) +LNUM$ +" " +S$ + LEFT$(BLANK$ +BLANK$,L2 +2 *B1 -2) +"/"
2510 B$(1) = LEFT$(BLANK$,L1 -B1) + LEFT$(UNDERLN$,L2/2 +B1) +"V" + LEFT$(UNDERLN$,L2/2 +B1) +" "
2520 IF FLOW$ = " " THEN B$(1) = LEFT$(B$(1),30) +U$ + MID$ (B$(1),32, LEN(B$(1))):FLOW$ = V$
2530 ON FLAG GOSUB 2570,2680,2790,2900,2900
2540 B$(J +4) = BLANK$ +FLOW$
2550 K = J +4
2560 GOTO 3490
2570 REM ------
2580 REM SCREEN
2590 REM ------
2600 K = INT((J +3)/2) +1
2610 B$(K -3) = B$(K -3) +" " + LEFT$(UNDERLN$,10)
2620 B$(K -2) = B$(K -2) +" / " +S$: REM 4/10 SPACES
2630 B$(K -1) = B$(K -1) +" / " +V$: REM 4/12 SPACES
2640 B$(K) = B$(K) +"--->( VIDEO " +V$
2650 B$(K +1) = B$(K +1) +" " +S$ + LEFT$(BLANK$,12) +V$
2660 B$(K +2) = B$(K +2) + LEFT$(BLANK$,8) +S$ + LEFT$(UNDERLN$,10) +"/"
2670 RETURN
2680 REM --------
2690 REM KEYBOARD
2700 REM --------
2710 K = INT((J +3)/2) +1
2720 B$(K -3) = B$(K -3) +" " + LEFT$(UNDERLN$,13)
2730 B$(K -2) = B$(K -2) +" / /": REM 4/12/ SPACES
2740 B$(K -1) = B$(K -1) +" / /": REM 4/12/ SPACES
2750 B$(K) = B$(K) +"<---/ KEYBOARD /"
2760 B$(K +1) = B$(K +1) +" / /": REM 4/12/ SPACES
2770 B$(K +2) = B$(K +2) +" /" + LEFT$(UNDERLN$,12) +"/"
2780 RETURN
2790 REM -------
2800 REM PRINTER
2810 REM -------
2820 K = INT((J +3)/2) +1
2830 B$(K -3) = B$(K -3) +" " + LEFT$(UNDERLN$,13)
2840 B$(K -2) = B$(K -2) +" " +V$ + LEFT$(BLANK$,13) +V$
2850 B$(K -1) = B$(K -1) +" " +V$ +" PRINTER " +V$
2860 B$(K) = B$(K) +"--->" +V$ + LEFT$(BLANK$,13) +V$
2870 B$(K +1) = B$(K +1) +" " +V$ +" " + LEFT$(UNDERLN$,6) +V$
2880 B$(K +2) = B$(K +2) +" " +V$ + LEFT$(UNDERLN$,6) +"/"
2890 RETURN
2900 REM ----
2910 REM DISK
2920 REM ----
2930 ARROW$ = "--->"
2940 IF FLAG = 5 THEN ARROW$ = "<---"
2950 K = INT((J +3)/2) +1
2960 B$(K -3) = B$(K -3) +" " + LEFT$(UNDERLN$,14)
2970 B$(K -2) = B$(K -2) +" /" + LEFT$(BLANK$,14) +S$
2980 B$(K -1) = B$(K -1) +" " +V$ +" DISK " +V$
2990 B$(K) = B$(K) +ARROW$ +V$ +S$ + LEFT$(UNDERLN$,14) +"/" +V$
3000 B$(K +1) = B$(K +1) +" " +V$ + LEFT$(BLANK$,16) +V$
3010 B$(K +2) = B$(K +2) +" " +S$ + LEFT$(UNDERLN$,14) +"/"
3020 RETURN
3030 REM -------
3040 REM SHAPE 3
3050 REM -------
3060 L = INT(J/2)
3070 IF J/2 = L THEN J = J +1:A$(J) = LEFT$(BLANK$,L2)
3080 L1 = 17
3090 B$(1) = LEFT$(BLANK$,L1) + LEFT$(UNDERLN$,13) +"V" + LEFT$(UNDERLN$,13)
3100 IF FLOW$ = " " THEN B$(1) = LEFT$(B$(1),30) +U$ + MID$ (B$(1),32, LEN(B$(1))):FLOW$ = V$
3110 B$(2) = LEFT$(BLANK$,L1 -9) +LNUM$ +" /" + LEFT$(BLANK$,27) +S$
3120 IF L = 0 THEN B$(3) = LEFT$(BLANK$,L1 -2) +"( " +A$(1) +" )": GOTO 3280
3130 B1$ = " "
3140 B1 = 2
3150 FOR K = 1 TO L
3160 B$(K +2) = LEFT$(BLANK$,L1 -B1) +"/" +B1$ +A$(K) +B1$ +S$
3170 B1$ = B1$ +" "
3180 B1 = B1 +1
3190 NEXT K
3200 B$(L +3) = LEFT$(BLANK$,L1 -B1) +"(" +B1$ +A$(K) +B1$ +")"
3210 B1$ = " "
3220 B1 = 1
3230 FOR K = L TO 1 STEP -1
3240 B$(K +L +3) = LEFT$(BLANK$,L1 -B1 -1) +S$ +B1$ +A$(L +K +1) +B1$ +"/"
3250 B1 = B1 +1
3260 B1$ = B1$ +" "
3270 NEXT K
3280 B$(J +3) = LEFT$(BLANK$,L1 -1) +S$ + LEFT$(UNDERLN$,27) +"/"
3290 B$(J +4) = BLANK$ +FLOW$
3300 REM PAD LINES WITH BLANKS
3310 L1 = LEN(B$(L +3)) +5
3320 FOR I = L +4 TO J +4
3330 B$(I) = LEFT$(B$(I) +BLANK$,L1)
3340 NEXT I
3350 REM ADD TEXT
3360 K = L +3
3370 B$(K) = B$(K) +ARROW$
3380 L2 = RMARGIN
3390 IF LEN(B$(K)) <L2 GOTO 3470
3400 IF MID$ (B$(K),L2,1) < >":" AND MID$ (B$(K),L2,1) < >" " AND MID$ (B$(K),L2,1) < >"," AND MID$ (B$(K),L2,1) < > CHR$(126) AND MID$ (B$(K),L2,1) < >";" THEN L2 = L2 -1: IF L2 >RMARGIN -10 GOTO 3400
3410 ARROW$ = MID$ (B$(K),L2 +1, LEN(B$(K)))
3420 B$(K) = LEFT$(B$(K),L2)
3430 K = K +1
3440 IF K >J +4 THEN B$(K) = LEFT$( LEFT$(B$(K -1),31) +BLANK$,L1)
3450 B$(K) = B$(K) +ARROW$
3460 GOTO 3380
3470 IF K <J +4 THEN K = J +4
3480 GOTO 3490
3490 REM ===========
3500 REM PRINT LINES
3510 REM ===========
3520 REM
3530 REM ----------
3540 REM MARK LOOPS
3550 REM ----------
3560 REM
3570 IF LCOUNT +K >(LPAGE) THEN GOSUB 4180
3580 IF LOOP = 0 GOTO 3660
3590 FOR I = 1 TO K
3600 IF I = 2 GOTO 3620
3610 B$(I) = LEFT$(B$(I),12 -2 *LOOP) + RIGHT$(": : : : : : : ",2 *LOOP) + MID$ (B$(I),13,79)
3620 NEXT I
3630 IF MID$ (B$,7,4) = "NEXT" GOTO 3760
3640 IF MID$ (B$,7,3) = "FOR" GOTO 3660
3650 GOTO 3880
3660 REM ----------
3670 REM START LOOP
3680 REM ----------
3690 IF MID$ (B$,7,3) < >"FOR" GOTO 3880
3700 B$(L) = LEFT$(B$(L),10 -2 *LOOP) + RIGHT$("..............",4 +2 *LOOP) + MID$ (B$(L),15,79): REM 14 PERIODS
3710 LOOP = LOOP +1
3720 FOR I = L +1 TO K
3730 B$(I) = LEFT$(B$(I),12 -2 *LOOP) + RIGHT$(": : : : : : : ",2 *LOOP) + MID$ (B$(I),13,79)
3740 NEXT I
3750 GOTO 3880
3760 REM --------
3770 REM END LOOP
3780 REM --------
3790 LOOP = LOOP -1
3800 B$(L) = LEFT$(B$(L),10 -2 *LOOP) + LEFT$(":.............",4 +2 *LOOP) + MID$ (B$(L),15,79): REM 13 PERIODS AFTER COLON
3810 FOR I = 7 TO 80
3820 IF MID$ (B$,I,1) = "," THEN LOOP = LOOP -1
3830 NEXT I
3840 FOR I = L +1 TO K
3850 B$(I) = LEFT$(B$(I),12 -2 *(LOOP +1)) +" " + MID$ (B$(I),14 -2 *(LOOP +1),79)
3860 IF LOOP = 0 THEN B$(I) = LEFT$(BLANK$,12) + MID$ (B$(I),13)
3870 NEXT I
3880 REM -----
3890 REM PRINT
3900 REM -----
3910 LCOUNT = LCOUNT +K
3920 FOR I = 1 TO K
3930 PRINT B$(I)
3940 NEXT I
3950 B$(K) = LEFT$(B$(K),31)
3960 NEXT II
3970 GOTO 580
3980 REM ---
3990 REM END
4000 REM ---
4010 IF PEEK(222) < >5 GOTO 4430
4020 IF LCOUNT >LPAGE -5 THEN GOSUB 4180
4030 IF FLOW$ = V$ THEN PRINT LEFT$(BLANK$,22) LEFT$(UNDERLN$,8)"V" LEFT$(UNDERLN$,8)
4040 IF FLOW$ = " " THEN PRINT LEFT$(BLANK$,22) LEFT$(UNDERLN$,17)
4050 PRINT LEFT$(BLANK$,21)V$ LEFT$(BLANK$,17)V$
4060 PRINT LEFT$(BLANK$,21)V$" END "V$
4070 PRINT LEFT$(BLANK$,21)V$ LEFT$(UNDERLN$,17)V$
4080 POKE 216,0
4090 FOR I = 5 TO LPAGE +BMARGIN -LCOUNT
4100 PRINT
4110 NEXT I
4120 PRINT D$"PR#0"
4130 PRINT D$"CLOSE"
4140 PRINT D$"OPEN EXE": PRINT D$"CLOSE EXE": PRINT D$"DELETE EXE"
4150 PRINT D$"OPEN EX1": PRINT D$"CLOSE EX1": PRINT D$"DELETE EX1"
4160 PRINT D$"OPEN EXX,D"D1: PRINT D$"CLOSE EXX": PRINT D$"DELETE EXX"
4170 NEW
4180 REM ============
4190 REM PRINT HEADER
4200 REM ============
4210 PRINT LEFT$(B$(K),30);
4220 IF FLOW$ = V$ THEN PRINT "V CONTINUED ON PAGE "PAGE +1:LCOUNT = LCOUNT +1
4230 IF FLOW$ < >V$ THEN PRINT " CONTINUED ON PAGE "PAGE +1:LCOUNT = LCOUNT +1
4240 GOSUB 4280
4250 PRINT BLANK$FLOW$" CONTINUED FROM PAGE "PAGE -1
4260 LCOUNT = 5
4270 RETURN
4280 REM ----------
4290 REM PRINT TEXT
4300 REM ----------
4310 FOR X = 1 TO LPAGE +BMARGIN -LCOUNT
4320 PRINT
4330 NEXT X
4340 PAGE = PAGE +1
4350 PRINT SPC( LMARGIN)NAME$ SPC( LNLGTH - LEN(NAME$) -9)"PAGE "PAGE
4360 PRINT SPC( LMARGIN)AUTH$ SPC( LNLGTH - LEN(AUTH$) -9)DT$
4370 PRINT SPC( LMARGIN);
4380 FOR X = 1 TO LNLGTH
4390 PRINT "-";
4400 NEXT X
4410 PRINT : PRINT
4420 RETURN
4430 E = PEEK(222):EL = PEEK(218) +256 * PEEK(219): POKE 216,0
4440 HOME : VTAB 12: PRINT "ERROR #"E" IN LINE "EL".": PRINT : PRINT "PRESS <ESC> TO QUIT,": PRINT "OR ANY OTHER KEY TO TRY AGAIN."
4450 GET Z$: IF Z$ < > CHR$(27) THEN ON EF GOTO 130,4460
4460 PRINT D$"PR#0": PRINT D$"CLOSE": END
4470 GET A$: IF A$ < > CHR$(13) GOTO 4470
4480 RETURN