8-Bit Software Online Conversion

Dual Print - Listing

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