8-Bit Software Online Conversion

:0.$.Printer - Listing

10programname$="PRINTER" 20REM LAST REVISED 1st November 30REM CANNON PRINTER 40SOUND1,-12,80,3:SOUND1,-12,96,3:SOU ND1,-12,100,3:SOUND1,-12,132,3 50DATAJanuary,February,March,April,Ma y,June,July,August,September,October,Nov ember,December 60DATAMonday,Tuesday,Wednesday,Thursd ay,Friday,Saturday,Sunday 70ONERROR PROCerror 80DIMF$(10) 90DIMD$(10) 100x%=32027:p%=200 110VDU15 120PALLET$="":REM full list of files t o be printed 130print$="":REM currently printed fil e segment 140chopper$="":REM used to select corr ect print sector 150ref$="":REM first sector of Pallet$ 160totalwidth%=80 170Lmargin%=6 180Rmargin%=4 190textwidth%=totalwidth%-(Lmargin%+Rm argin%) 200centre%=(textwidth%/2)+Lmargin% 210totalheight%=70 220topmarg%=6 230botmarg%=6 240textheight%=totalheight%-(botmarg%+ topmarg%) 250line%=1:page%=1 260month$="" 270bit$="" 280line$="" 290fold$="" 295end$="" 300date$="" 310cont$="" 320drive%=1 330message$="" 340PROCdate 350PROCget`info 360FORcopy%=1TOcopies% 370page%=1:line%=1:chopper$=PALLET$ 380PROCcheck`printer 390PROCprint`heading 400IFaddress$="Y"THENPROCaddress 401IFdrive%=0THEN*DR.0 402IFdrive%=1THEN*DR.1 403IFdrive%=2THEN*DR.2 404IFdrive%=3THEN*DR.3 410PROCprintout 420PROCeject`paper 430NEXTcopy% 440RUN 450 460DEFPROCerror 470VDU3 480*FX4 0 490IFERR=222THEN540 500PRINT:PRINT"Error ";ERR;" at line " ;ERL;:REPORT:PRINT:PRINT 510IFERR=17THEN*FX21,3 520IFERR=17THENPROCeject`paper 530END 540CLS:VDU7:PRINT:PRINT"ERROR ..."''pr int$;" is not on this disc."'' 550*CAT 560PRINT''"INSERT correct disk, and hi t any key ...":A=GET:VDU2:PROCprintout 570 580DEFPROCget`info 590VDU23,1,0;0;0;0; 600*DR.1 610*FX4,1 620CLS 630x%=32027:p%=200 640PRINTCHR$(134);CHR$(157);CHR$(129); CHR$(141);"PRINTER for drive ";drive% 650PRINTCHR$(134);CHR$(157);CHR$(129); CHR$(141);"PRINTER for drive ";drive% 660PRINT:*. 670v%=VPOS+1 680n%=0:M=31863:disc$="":FORi%=1TO12:d isc$=disc$+CHR$(M?i%):NEXT 690IF?(1+x%+(n%*20))<>32THENn%=n%+1:GO TO690 700PROCflag 710*FX21,0 720G=GET 730IFG=44THENPALLET$=PALLET$+F$+",":GO TO795 740IFG=46THENPALLET$=PALLET$+F$+".":GO TO795 745IFG=127THENPALLET$=LEFT$(PALLET$,LE N(PALLET$)-8):VDU7:PRINTTAB(1,v%)PALLET$ +" " 750IFG>47ANDG<52THENPROCdrive(G-48):GO TO620 760IFG>135ANDG<140THENPROCjump(G):PROC flag 770IFG=33CHAIN":0.CONTROL" 780IFG=13THENPALLET$=PALLET$+F$:PRINTT AB(1,v%)PALLET$:GOTO800 790GOTO710 795PRINTTAB(1,v%)PALLET$:PROCjump(137) :PROCflag:GOTO710 800ref$=LEFT$(PALLET$,7)+" ":ref$=LEFT $(ref$,INSTR(ref$," ")-1) 810PRINT'"How many copies ... ";:A=GET :IFA=33RUN 820IFA=13copies%=1:GOTO1210 830IFA=48 copies%=10:GOTO1210 840IFA>57ORA<48THENGOTO810 850copies%=A-48:PRINTcopies% 860GOTO1210 870 880DEFPROCdrive(A) 890IFA=0THEN*DR.0 900IFA=1THEN*DR.1 910IFA=2THEN*DR.2 920IFA=3THEN*DR.3 930drive%=A 940ENDPROC 950 960DEFPROCjump(G) 970?(x%-2)=32:?(x%-1)=32:?x%=32 980IFG=136THENx%=x%-20:p%=p%+4 990IFG=137THENx%=x%+20:p%=p%-4 1000IFG=138THENx%=x%+40:p%=p%-8 1010IFG=139THENx%=x%-40:p%=p%+8 1020ENDPROC 1030 1040DEFPROCflag 1050F$="":FORI=1TO7:F$=F$+CHR$(?(x%+I)) :NEXT 1060IFASC(F$)=33THENPROCjump(137):GOTO1 050 1070IFASC(F$)=32GOTO1150 1080?(x%-2)=129:?(x%-1)=93:?x%=130:?(x% +13)=135 1090*FX21,5 1100*FX21,6 1110SOUND1,-10,p%,5:SOUND2,-15,250,3 1120ENDPROC 1130 1140DEFPROCoverflow 1150IFG=136THENx%=x%+(n%*20):p%=p%-(n%* 4) 1160IFG=137THENx%=32027:p%=200 1170IFG=138THENx%=32027:p%=200 1180IFG=139THENx%=x%+(n%*20):p%=p%-(n%* 4) 1190GOTO1050 1200 1210CLS:PRINT"The following headings ar e available:":PRINT 1220PRINTTAB(8)"0. None" 1230PRINTTAB(8)"1. Plain Tanrallt" 1240PRINTTAB(8)"2. JOHN NICHOLSON" 1250PRINTTAB(8)"3. Local Green Party" 1260PRINTTAB(8)"4. Press release" 1270PRINTTAB(8)"5. Fiona Stidworthy" 1280PRINTTAB(8)"6. Patricia Knox" 1285PRINTTAB(8)"7. Canolfan Caernarfo n" 1286PRINTTAB(8)"8. Ramblers" 1290REM add extra options here 1300 1310PRINT:PRINT"Enter heading choice .. . ";:A=GET:IFA=33CLS:GOTO810 1320IFA=13heading%=2:GOTO1350 1330IFA>57 OR A<48GOTO1310 1340heading%=A-48:PRINTheading% 1350CLS 1360*DRIVE2 1370address$="N":PRINT''"Enter the addr ess search mask ...":G=GET:IFG=33CLS:GOT O1210 1380IFG=13ENDPROC 1390IFG=63ORG=47THENPRINT''" * to sear ch only the new records."'" @ to search with FILENAME as a mask.":GOTO1370 1400IFG=64THENmask$=filenames$:GOTO1430 1410G$=CHR$(G):PRINTG$; 1420INPUTLINE""F$:mask$=G$+F$ 1430*DRIVE2 1440CLOSE#0:search=OPENUP("NADFILE"):IN PUT#search,x%,y%,filename$,filedesc$ 1450IFG=42THENPTR#search=y%:mask$=RIGHT $(mask$,(LEN(mask$)-1)) 1460IFmask$="@"THENmask$=filenames$ 1470PRINT''"Searching through ";filenam e$;", for ";mask$"." 1480INPUT#search,R$:IFLEFT$(R$,11)="END OF FILE"THENCLOSE#search:PRINTmask$;" w as not found in ";filename$:GOTO1360 1490IFINSTR(R$,mask$)=0GOTO1480 1500VDU7:FORI=1TO10:F$(I)=LEFT$(R$,INST R(R$,"|")-1):R$=RIGHT$(R$,(LEN(R$)-(LEN( F$(I))+1))):NEXTI 1510FORL=1TO5:PROClowercase:NEXTL 1520FORL=6TO10:D$(L)=F$(L):NEXTL 1530CLS:PRINTTAB(8,6)""; 1540IFD$(2)<>""PRINTD$(2);" ";D$(1) 1550FORQ=3TO8:IFD$(Q)<>""PRINTTAB(8)D$( Q) 1560NEXTQ 1570PRINT''"HIT 'Return' to accept this address,"'" any other key to continu e searching.":*FX21,0 1580G=GET:IFG=33GOTO1350 1590IFG<>13GOTO1480 1600address$="Y":*DRIVE0 1610ENDPROC 1620 1630DEFPROCfilenames 1640IFASC(FILES$)=46THENline%=textheigh t% 1650IFLEN(FILES$)<8THENfile$=FILES$ 1660file$=LEFT$(FILES$,7):FILES$=RIGHT$ (FILES$,LEN(FILES$)-8) 1670ENDPROC 1680 1690DEFPROClowercase 1700IFF$(L)=""THEND$(L)="":GOTO1800 1710P$=LEFT$(F$(L),1) 1720FORC=2TOLEN(F$(L)) 1730C$=MID$(F$(L),C,1) 1740IFC$=" "THENC=C+1:P$=P$+C$+MID$(F$( L),C,1):GOTO1780 1750IFC$="-"ORC$="."THEN1810 1760IFASC(C$)>64ANDASC(C$)<123THENP$=P$ +CHR$(ASC(C$)+32):GOTO1780 1770P$=P$+C$ 1780NEXTC 1790D$(L)=P$ 1800ENDPROC 1810P$=P$+C$:C=C+1 1820IFMID$(F$(L),C,1)=" "THENP$=P$+" "+ MID$(F$(L),C+1,1):C=C+1:GOTO1780 1830P$=P$+MID$(F$(L),C,1):GOTO1780 1840 1850DEFPROCdate 1860RESTORE50:FORI=1TOM%:READmonth$:NEX TI 1870IFN%>0:RESTORE60:FORI=1TON%:READday name$:NEXTI 1880bit$="":IFD%=1ORD%=21ORD%=31THENbit $="st." 1890IFD%=2ORD%=22THENbit$="nd." 1900IFD%=3ORD%=23THENbit$="rd." 1910IFbit$=""THENbit$="th." 1920date$=dayname$+", "+STR$(D%)+bit$+" "+month$+" "+STR$(Y%)+"." 1930ENDPROC 1940 1950DEFPROCcheck`printer 1960VDU2 1970VDU1,27,64 1980VDU1,7,13 1990VDU3 2000*FX21,3 2005cont$="" 2010CLS:PRINTTAB(8,8)"Ready To print co py ";copy%;" of ";copies%;".":PRINTTAB(8 ,10)"CHECK PRINTER IS READY":PRINT:PRINT TAB(8,12)"and hit any key . . . ." 2020PRINT:PRINT:PRINT"HIT 'c' for conti nuous paper feed."'" 'C' for continuo us document feed."'" 'N' for Near let ter quality. "'" 'I' for Italic t ext. "'" 'E' for Elite te xt" 2030PRINT" 'D' for condensed text."' " 'M' for micro printing." 2040A=GET:IFA=13THENCLS:ENDPROC 2050A$=CHR$(A):IFA$="!"THENGOTO1350 2060IFA$="C"THENPRINTTAB(6,3)"Continuou s document feed ON. ":cont$=cont$+"C" 2061IFA$="c"THENPRINTTAB(6,3)"Continuou s sheet feed ON. ":cont$=cont$+"c" 2070IFA$="D"ORA$="d"THENPRINTTAB(8,3)"C ondensed text ON. ":cont$=cont$+"D" 2080IFA$="N"ORA$="n"THENcont$=cont$+"N" :PRINTTAB(8,3)"Near letter quality ON. " 2090IFA$="I"ORA$="i"THENPRINTTAB(8,3)"I talic text ON. ":cont$=cont$+"I" 2100IFA$="E"ORA$="e"THENcont$=cont$+"E" :PRINTTAB(8,3)"Elite text ON. " 2110IFA$="M"ORA$="m"THENcont$=cont$+"M" :PRINTTAB(8,3)"Micro printing ON. " 2120PRINTTAB(20,20)"":GOTO2040 2130 2140DEFPROCaddress 2150IFD$(2)<>""PRINTTAB(Lmargin%)D$(2); " ";D$(1);",":line%=line%+1 2160FORQ=3TO5:IFD$(Q)<>""PRINTTAB(Lmarg in%)D$(Q);",":line%=line%+1 2170NEXTQ 2180IFD$(6)<>""PRINTTAB(Lmargin%)D$(6); ".":line%=line%+1 2190IFD$(7)<>""PRINTTAB(Lmargin%)D$(7): line%=line%+1 2200IFheading%=6ANDdate$>""THENPRINT:PR INT:PRINTTAB(Lmargin%)date$:PRINTTAB(Lma rgin%)FILENAMES$:line%=line%+4 2210PRINT:PRINT:line%=line%+2 2220ENDPROC 2230 2240DEFPROCprintout 2250print$=LEFT$(chopper$,7):chopper$=R IGHT$(chopper$,LEN(chopper$)-7) 2300CLOSE#0 2310ch=OPENIN(print$) 2320line$=fold$:fold$="" 2330IFline%>textheight%THENPROCnew`page 2340char%=BGET#(ch) 2350IFEOF#(ch)=-1THENPROCprintline:GOTO 2490 2360IFchar%=13ANDline$="":PRINT:line%=l ine%+1:GOTO2330 2370IFchar%=13THENPROCprintline:PRINT:f old$="":line$="":GOTO2330 2380IFchar%=&02 THENPROCmessage:GOTO240 0 2390line$=line$+CHR$(char%) 2400IFLEN(line$)<textwidth%GOTO2340 2410IFLEN(line$)=1THENline$=LEFT$(fold$ ,textwidth%):PROCprintline:fold$="":GOTO 2320 2420end$=RIGHT$(line$,1) 2430IFend$=" "THENPROCprintline:GOTO232 0 2440line$=LEFT$(line$,LEN(line$)-1) 2450fold$=end$+fold$ 2460GOTO2410 2470 2480REM EOF 2490PRINT:IFLEN(chopper$)<8ENDPROC 2491IFASC(chopper$)=46THENline%=texthei ght% 2492chopper$=RIGHT$(chopper$,LEN(choppe r$)-1) 2500GOTO2250 2510 2520 2530DEFPROCprintline 2540IFASC(line$)=32THENline$=RIGHT$(lin e$,LEN(line$)-1) 2550PRINTTAB(Lmargin%);line$; 2560line%=line%+1 2570ENDPROC 2580 2590DEFPROCnew`page 2600page%=page%+1 2610line%=1 2620PRINT''TAB(centre%-14)". . . conti nued on page ";page%;"."; 2630FORI=1TO(botmarg%-2):PRINT:NEXTI 2640PRINT"-"; 2650FORI=1TO(topmarg%-2):PRINT:NEXTI 2660IFINSTR(cont$,"C")THEN2710 2670IFINSTR(cont$,"c")THEN2710 2680VDU7:VDU3:CLS:PRINTTAB(6,10)"Page " ;page%;"."''"HIT ANY KEY TO CONTINUE":*F X21,0 2690A=GET:IFA=67THENcont$=cont$+"C" 2700IFA=99THENcont$=cont$+"c" 2705CLS:VDU2 2710PRINTTAB(centre%-12)". . . Page "; page%;" . . ."' 2730ENDPROC 2740 2750DEFPROCeject`paper 2760CLOSE#0 2770FORL=line%TOtotalheight%:PRINT:NEXT L:PRINT"-":FORL=0TOtopmarg%:PRINT:NEXTL: VDU3:*FX21,3 2780VDU7 2790ENDPROC 2800 2810DEFPROCmessage 2820message$="" 2830char%=BGET#(ch):IFchar%=&07THEN2850 2840message$=message$+CHR$(char%):GOTO2 830 2850IFmessage$="OC1,14"THENVDU1,14:REMe nlarged 2860IFmessage$="OC1,27,40"THENVDU1,27,4 0:REMnlq 2870IFmessage$="OC1,27,80"THENVDU1,27,8 0:REMnlqoff 2880IFmessage$="OC1,27,69"THENVDU1,27,6 9:REMemphasised 2890IFmessage$="OC1,27,70"THENVDU1,27,7 0:REMemphasised off 2900IFmessage$="OC1,27,71"THENVDU1,27,7 1:REMdouble strike 2910IFmessage$="OC1,27,72"THENVDU1,27,7 2:REMdouble strike off 2920IFmessage$="BP"THENline%=textheight % 2930ENDPROC 2940 2950DEFPROCprint`heading 2960VDU2 2970VDU1,27,64:REMreset 2980VDU1,27,69:REMbold 2990*FX6,0 3000VDU1,27,69 3010VDU1,27,71 3020ON(heading%+1)GOSUB3130,3160,3260,3 340,3420,3500,3600,5000,6000 3030VDU1,27,70:REMboldoff 3040IFINSTR(cont$,"M")THENVDU1,27,83,49 :VDU1,27,48:VDU1,15:textwidth%=130:Lmarg in%=2:textheight%=77 3050IFINSTR(cont$,"I")THENVDU1,27,52 3060IFINSTR(cont$,"E")THENVDU1,27,77:te xtwidth%=85 3070IFINSTR(cont$,"D")THENVDU1,15:textw idth%=120:Lmargin%=11 3080IFINSTR(cont$,"N")THENVDU1,27,40 3090IFheading%>0ANDdate$>""THENPRINTTAB (centre%)date$:PRINTTAB(centre%);disc$;" / ";ref$;".":line%=line%+2 3100ENDPROC 3110 3120REM heading0 3130RETURN 3140 3150REM heading1 3160PRINTTAB(centre%-4);"Tanrallt," 3170PRINTTAB(centre%-5);"Rhostryfan," 3180PRINTTAB(centre%-5);"Caernarfon," 3190PRINTTAB(centre%-4);"GWYNEDD." 3200PRINTTAB(centre%-4);"LL54 7NT." 3210PRINT:PRINTTAB(centre%-11);"Llanwnd a (0286) 830312"' 3220line%=line%+7 3230RETURN 3240 3250REM heading2 3260PRINTTAB(Lmargin%);:VDU1,14:PRINT"J OHN NICHOLSON." 3270PRINTTAB(Lmargin%);"Tanrallt, Rhost ryfan, Caernarfon, Gwynedd, LL54 7NT."; 3280PRINTTAB(Lmargin%)"Telephone: Llan wnda (0286) 830312" 3290PRINTTAB(Lmargin%)STRING$(textwidth %-2,"`") 3300line%=line%+5 3310PRINT:RETURN 3320 3330REM heading3 3340PRINTTAB(Lmargin%);:VDU1,14:PRINT"T HE GREEN PARTY OF" 3350PRINTTAB(Lmargin%);:VDU1,14:PRINT"N ORTH WEST WALES." 3360PRINTTAB(Lmargin%);"Secretary:":PRI NTTAB(Lmargin%);"John Nicholson, Tanra llt, Rhostryfan, Caernarfon, Gwynedd, LL 54 7NT.":PRINTTAB(Lmargin%)"Telephone (0 286) 830312." 3370PRINTTAB(Lmargin%)STRING$(textwidth %-2,"`")'' 3380line%=line%+8 3390RETURN 3400 3410REM heading4 3420PRINTTAB(Lmargin%);STRING$(4,"PRESS RELEASE "); 3430PRINTTAB(Lmargin%);STRING$(70,"`"): PRINT 3440PRINTTAB(Lmargin%);"From John Nicho lson, secretary of the Arfon and Dwyfor Green Party." 3450PRINTTAB(Lmargin%);"Tanrallt, Rhost ryfan, Caernarfon, Gwynedd, LL54 7NT. ( 0286) 830312." 3460line%=line%+6 3470PRINT':RETURN 3480 3490REM heading5 3500VDU1,27,71:PRINTTAB(Lmargin%+25);"F iona Stidworthy,":VDU1,27,72 3510PRINTTAB(Lmargin%+24);"Gorffwysfa, Saron," 3520PRINTTAB(Lmargin%+30);"Bethel," 3530PRINTTAB(Lmargin%+28);"Caernarfon." 3540PRINTTAB(Lmargin%+29);"Gwynedd." 3550PRINTTAB(Lmargin%+28);"LL55 1YT." 3560PRINTTAB(Lmargin%+26);"(0248) 67010 1."' 3570line%=line%+8:RETURN 3580 3590REM heading6 3600VDU1,27,71:PRINTTAB(Lmargin%+50);"P atricia Knox," 3610PRINTTAB(Lmargin%+50);"Pen Llywenan ," 3620PRINTTAB(Lmargin%+50);"Bodedern," 3630PRINTTAB(Lmargin%+50);"Holyhead," 3640PRINTTAB(Lmargin%+50);"YNYS MON." 3650PRINTTAB(Lmargin%+50);"LL65 4TS" 3660PRINT:PRINTTAB(Lmargin%+50);"0407 7 40767" 3670FORI=1TO8:VDU1,27,106,36:NEXTI 3680RETURN 3690 5000REM heading7 5001VDU1,14:PRINT" CANOLFAN CAE RNARFON Cyf.":PRINTTAB(centre%-13);"(Cha rity number 2667354.)"' 5002PRINTTAB(centre%-14);"Secretary: Ro semary Edwards," 5003PRINTTAB(centre%-6);"3 Bron Arfon," 5004PRINTTAB(centre%-3);"Carmel," 5005PRINTTAB(centre%-5);"Caernarfon," 5006PRINTTAB(centre%-12);"Ffon/Tele: 02 86 880116." 5007PRINTTAB(centre%-12);"Facs/Fax: 02 86 672201." 5100line%=line%+11:PRINT:PRINT:RETURN 5105 6000REM heading8 6001PRINTTAB(Lmarg%)"FROM:":PRINTTAB(Lm arg%)"John Nicholson,":PRINTTAB(Lmarg%)" Tanrallt, Rhostryfan,":PRINTTAB(Lmarg%)" Caernarfon, Gwynedd, LL54 7NT."':PRINTTA B(Lmarg%)"(0286) 830312.":line%=line%+6: RETURN