100 REM PRINT_2 110 REM David Robinson 9-March-89 120 REM Latest revision 4-Feb-94 130 REM Released to public domain 24-Oct-94 140 : 150 REM See associated file PRINtxt 160 REM for program description and 170 REM instructions 180 : 190 Title$="PRINTS 2 TEXT FILES SIDE BY SIDE" 200 : 210 MODE 7 220 PROCinit 230 PROCheading 240 ON ERROR PROCerror 250 PROCopen_files 260 PROCsetup_printer 270 PROCprint_2 280 PROCreset_printer 290 PROCclose 300 END 310 : 320 : 330 DEF PROCheading 340 PRINT 350 FOR Line=1 TO 2 360 PRINT TAB(18-INT(LEN(Title$)/2)); dbl$+grn$+Title$ 370 NEXT Line 380 PRINT 390 ENDPROC 400 : 410 DEF PROCinit 420 REM Number of characters wide per side 430 Cmax=60 440 REM Printer carriage width in condensed mode characters 450 Width=135 460 Word$=STRING$(60," ") 470 Line$=Word$ 480 Part$=Word$ 490 Word$="": Line$="": Part$="" 500 FF=0 510 red$=CHR$(129) 520 grn$=CHR$(130) 530 yel$=CHR$(131) 540 wht$=CHR$(135) 550 dbl$=CHR$(141) 560 REM Text window top and bottom 570 Wt=9: Wb=18 580 DONE=FALSE 590 ENDPROC 600 : 610 DEF PROCerror 620 ON ERROR OFF 630 *FX3,0 640 VDU 28,0,24,39,0 650 PRINT TAB(0,21) 660 REPORT: PRINT red$; "at line "; ERL 670 PROCclose 680 END 690 ENDPROC 700 : 710 DEF PROCopen_files 720 PRINT TAB(0,Wt-2); STRING$(40,"_") 730 FOR L=Wt-1 TO Wb+1 740 PRINT TAB(18,L); wht$+"|" 750 NEXT L 760 PRINT TAB(0,Wb+2); STRING$(40,"_") 770 VDU 28,0,Wb,17,Wt 780 LEFT=FNopen("LEFT") 790 VDU 28,21,Wb,39,Wt 800 RIGHT=FNopen("RIGHT") 810 VDU 28,0,24,39,0 820 PRINT TAB(0,21) 830 ENDPROC 840 : 850 DEF PROCsetup_printer 860 REM Output to Printer only 870 *FX3,10 880 REM Set Epson printer to Condensed 890 VDU 15 900 REM & 30/216" line spacing 910 REM 10/72" ie 27,65,10 Doesn't work (Ignore 10) 920 VDU 27,51,30 930 REM Unidirectional printing 940 VDU 27,85,1 950 ENDPROC 960 : 970 DEF PROCprint_2 980 file=LEFT 990 REPEAT 1000 PROCadd_a_letter 1010 IF DONE THEN PROCprint 1020 UNTIL EOF#(LEFT) AND EOF#(RIGHT) 1030 ENDPROC 1040 : 1050 DEF PROCreset_printer 1060 REM Cancel Condensed mode 1070 VDU 18 1080 REM 1/6 inch line spacing 1090 VDU 27,50 1100 REM Bidirectional printing 1110 VDU 27,85,0 1120 REM Printer off & VDU on 1130 *FX3,0 1140 ENDPROC 1150 : 1160 DEF PROCprint 1170 IF file=LEFT THEN PRINT Line$; TAB(INT(Width/2)); "|"; 1180 IF file=RIGHT THEN PRINT TAB(Width-Cmax); Line$ 1190 IF file=LEFT THEN file=RIGHT ELSE file=LEFT 1200 IF FF=LEFT+RIGHT THEN PRINT CHR$(12);: FF=0 1210 Line$=Part$ 1220 Part$=Word$ 1230 Word$="" 1240 DONE=FALSE 1250 ENDPROC 1260 : 1270 DEF FNopen(side$) 1280 PRINT yel$+side$; "-HAND FILE" 1290 REPEAT 1300 PRINT 1310 INPUT "name: " Fname$ 1320 file=OPENIN(Fname$) 1330 IF file=0 THEN PRINT red$; "File Not Found" 1340 UNTIL file>0 1350 PRINT 1360 PRINT EXT#file; " bytes" 1370 =file 1380 : 1390 DEF PROCadd_a_letter 1400 IF EOF#(file) THEN PROCadd_word: DONE=TRUE: ENDPROC 1410 IF FF=file THEN DONE=TRUE: ENDPROC 1420 A%=BGET#(file) 1430 IF A%=&0C THEN FF=FF+file: PROCadd_word: DONE=TRUE: ENDPROC 1440 IF A%=&0D THEN PROCadd_word: DONE=TRUE: ENDPROC 1450 IF A%<&20 THEN ENDPROC 1460 Word$=Word$+CHR$(A%) 1470 IF A%=&20 THEN PROCadd_word 1480 IF LEN(Word$)=Cmax THEN PROCadd_word 1490 IF LEN(Line$+Word$)>Cmax THEN DONE=TRUE 1500 ENDPROC 1510 : 1520 DEF PROCadd_word 1530 Line$=Line$+Word$ 1540 Word$="" 1550 ENDPROC 1560 : 1570 DEF PROCclose 1580 CLOSE#LEFT 1590 CLOSE#RIGHT 1600 ENDPROC