10
20
30
40
50
60
70 :
80 MODE7
90 IF(HIMEM-TOP)<&4700 THEN PAGE=PAGE-(&4700-(HIMEM-TOP)):CHAIN"LaBelle"
100 ON ERROR GOTO 4100
110 PROCinit
120 REPEAT
130 MODE7
140 PROCmainmenu
150 IF M%=1 MODE7:PROCsetup:PROCparams
160 IF M%=2 MODE7:PROCfile
170 IF M%=3 MODE3:PROCedit
180 IF M%=4 MODE7:PROCprint
190 IF M%=42 PRINTTAB(0,5):PROCos
200 UNTIL M%=5:PRINT'
210 *FX4
220 END
230 :
240 DEFPROCparams
250 max%=height%/13
260 maxlines%=height%/15
270 lf%(1)=15:lf%(2)=28:lf%(3)=32
280 lf%(4)=32
290 len%(1)=maxlen%:len%(2)=maxlen%:len%(3)=(maxlen%*3/5)
300 len%(4)=(maxlen%*3/10)
310 inset%(0)=0:inset%(2)=0:inset%(3)=(maxlen%-len%(3))/2
320 inset%(4)=(maxlen%-len%(4))/2
330 IF flag1% PROCtotlf
340 flag1%=TRUE
350 ENDPROC
360 :
370 DEFPROCinit
380 *KEY0 |!|A
390 *KEY1 |!|B
400 *KEY2 |!|C
410 *KEY3 |!|D
420 *KEY4 |!|E
430 *KEY5 |!|F
440 *KEY6 |!|G
450 *KEY7 |!|L
460 *FX4,1
470 F$="No file"
480 abort%=FALSE
490 exit%=FALSE
500 flag1%=FALSE
510 tit$=CHR$129+CHR$157+CHR$131+CHR$141+"LABELLE "+CHR$156
520 DIM data$(25),type%(25),style%(25),len%(4),inset%(4),lf%(4)
530 height%=270
540 maxlen%=60
550 totlf%=0
560 pmargin%=0
570 pitch%=324
580 clear$=STRING$(maxlen%," ")
590 PROCparams
600 FOR B%=0 TO max%
610 type%(B%)=1:style%(B%)=1
620 data$(B%)=clear$
630 NEXT B%
640 DIM option$(8)
650 DATA Set up,Filing,Edit label,Print Label,Quit
660 FOR N%=1TO5
670 READ option$(N%)
680 NEXT N%
690 VDU 23;11,0;0;0;0
700 ENDPROC
710 :
720 DEFPROCtitle
730 PRINTTAB(12,1)tit$'TAB(12,2)tit$
740 ENDPROC
750 :
760 DEFPROCmainmenu
770 *FX21
780 PROCtitle
790 VDU 28,0,24,39,6
800 FOR N%=1TO5
810 PROCline(N%,32,156,135)
820 NEXT N%
830 line%=1:select%=FALSE
840 PROCline(line%,132,157,135)
850 REPEAT
860 oldline%=line%
870 G%=GET
880 IF G%=138 line%=line%-(line%<5)
890 IF G%=139 line%=line%+(line%>1)
900 M%=G%-48
910 IF M%<6 AND M%>0 line%=M%:select%=TRUE
920 IF G%=42 M%=42:select%=TRUE
930 IF G%=13 M%=line%:select%=TRUE
940 PROCline(oldline%,32,156,135)
950 PROCline(line%,132,157,135)
960 UNTIL select%=TRUE
970 G%=INKEY(10)
980 ENDPROC
990 :
1000 DEFPROCline(N%,newcol%,back%,col%)
1010 PRINT TAB(10,N%)CHR$newcol%;CHR$back%;CHR$col%;N%;" ";option$(N%);TAB(27,N%);CHR$156;TAB(13,N%);
1020 ENDPROC
1030 :
1040 DEFPROCdisplay
1050 VDU 28,0,1,79,0
1060 PRINT F$;
1070 PRINT TAB(10,1)"|";TAB(10+inset%(3),1)"|";TAB(10+inset%(4),1)"|";
1080 PRINTTAB(10+len%(4)+inset%(4),1)"|";TAB(10+len%(3)+inset%(3)-1,1)"|";TAB(10+maxlen%-1,1)"|";
1090
1100 PROCmark
1110 VDU28,10,24,79,2
1120 CLS
1130 FOR N%=0 TO maxlines%
1140 PRINT TAB(inset%(type%(N%)),N%)data$(N%);
1150 NEXT N%
1160 ENDPROC
1170 :
1180 DEFPROCsetup
1190 PROCtitle
1200 cvpitch%=pitch%:cvheight%=height%:cvpmargin%=pmargin%:cvmaxlen%=maxlen%
1210 VDU 28,0,24,39,6
1220 PRINT TAB(3)"Label pitch 1/216 in.";cvpitch%
1230 PRINT TAB(3)"Height in 1/216 in...";cvheight%
1240 PRINT TAB(3)"Margin in characters..";cvpmargin%
1250 PRINTTAB(3)"Width in characters...";cvmaxlen%
1260 REPEAT
1270 REPEAT
1280 INPUT TAB(31,0)pitch%
1290 UNTIL pitch%>=0 AND pitch%<=648
1300 IFpitch%=0:pitch%=cvpitch%
1310 PRINT TAB(31,0);pitch%;SPC(3);
1320 REPEAT
1330 INPUT TAB(31,1)height%
1340 UNTIL height%>=0 AND height%<=594
1350 IFheight%=0:height%=cvheight%
1360 PRINT TAB(31,1);height%;SPC(3)
1370 UNTIL height%<pitch%
1380 REPEAT
1390 PRINT TAB(31,1);height%;SPC(3)
1400 INPUT TAB(31,2)pmargin$
1410 IF pmargin$="" pmargin%=cvpmargin% ELSE pmargin%=VAL(pmargin$)
1420 UNTIL pmargin%>=0 AND pmargin%<100
1430 PRINT TAB(31,2);pmargin%;SPC(3);
1440 REPEAT
1450 INPUT TAB(31,3)maxlen%
1460 UNTIL maxlen% >=0 AND maxlen%<=60
1470 IF maxlen%=0 maxlen%=cvmaxlen%
1480 PRINT TAB(31,3);maxlen%;SPC(3)
1490 ENDPROC
1500 :
1510 DEFPROCfile
1520 PROCtitle
1530 *.
1540 PRINT"<L>oad or <S>ave? ";
1550 X=GET OR 32
1560 IF X=108 PROCload
1570 IF X=115 PROCsave
1580 ENDPROC
1590 :
1600 DEFPROCload
1610 VDU 28,0,24,39,23
1620 CLS
1630 REPEAT
1640 INPUT"File name to load: "F$
1650 UNTIL LENF$<25
1660 IF F$="" ENDPROC
1670 F=OPENIN(F$):IF F=0 PRINT"File '"F$"' not found.":X=GET:ENDPROC
1680 INPUT#F,max%,pitch%,height%,pmargin%,maxlen%
1690 FOR N%=0 TO max%
1700 INPUT#F,style%(N%),type%(N%),data$(N%)
1710 NEXT N%
1720 CLOSE#F
1730 PROCparams
1740 ENDPROC
1750 :
1760 DEFPROCsave
1770 VDU 28,0,24,39,23
1780 CLS
1790 REPEAT
1800 INPUT"File name to save: "F$
1810 UNTIL LENF$<25
1820 IF F$="" ENDPROC
1830 F=OPENOUT(F$):IF F=0 PRINT"Can't open '"F$"'.";:X=GET:ENDPROC
1840 PRINT#F,max%,pitch%,height%,pmargin%,maxlen%
1850 FOR N%=0 TO max%
1860 PRINT#F,style%(N%),type%(N%),data$(N%)
1870 NEXT N%
1880 CLOSE#F
1890 ENDPROC
1900 :
1910 DEFPROCedit
1920 *FX15
1930 A%=0:B%=0
1940 PROCtotlf
1950 PROCdisplay
1960 REPEAT
1970 PROCcursor
1980 PRINT TAB(A%+inset%(type%(B%)),B%);
1990 PROCkeyin
2000 UNTIL I%=129
2010 I%=0
2020 ENDPROC
2030 :
2040 DEFPROCkeyin
2050 REPEAT
2060 I$=INKEY$(0):I%=ASC(I$)
2070 UNTIL I$<>""
2080 IF I%>126 OR I%<32 PROCctrl:ENDPROC
2090 IF A%>=len%(type%(B%)) ENDPROC
2100 PROCmidstr
2110 A%=A%+1
2120 ENDPROC
2130 :
2140 DEFPROCctrl
2150 IF INKEY(-1)PROCshift:ENDPROC
2160 IF I%=139 A%=0:B%=B%+(B%>0):ENDPROC
2170 IF I%=138 OR I%=13 A%=0:B%=B%-(B%<maxlines%):ENDPROC
2180 IF I%=136 A%=A%+(A%>0):ENDPROC
2190 IF I%=137 A%=A%-(A%<LENdata$(B%)):ENDPROC
2200 IF (I%=127 OR I%=8) I$=" ":PROCmidstr:A%=A%+(A%>0):ENDPROC
2210 IF I%>129 PROCselect
2220 IF I%=9 AND A%< LENdata$(B%)-10 A%=A%+10
2230 ENDPROC
2240 :
2250 DEFPROCshift
2260 IF I%=136 PROCdel
2270 IF I%=137 PROCins
2280 IF I%=138 PROCinsline
2290 IF I%=139 PROCdelline
2300 ENDPROC
2310 :
2320 DEFPROCmidstr
2330 data$(B%)=LEFT$(data$(B%),A%)+I$+MID$(data$(B%),A%+2)
2340 data$(B%)=FNfixlen(data$(B%))
2350 PRINT TAB(inset%(type%(B%)),B%)data$(B%);
2360 ENDPROC
2370 :
2380 DEFPROCdel
2390 data$(B%)=LEFT$(data$(B%),A%)+MID$(data$(B%),A%+2)+" "
2400 data$(B%)=FNfixlen(data$(B%))
2410 PRINT TAB(inset%(type%(B%)),B%)data$(B%)
2420 ENDPROC
2430 :
2440 DEFPROCins
2450 IF A%=maxlen% ENDPROC
2460 data$(B%)=LEFT$(data$(B%),A%)+" "+MID$(data$(B%),A%+1)
2470 data$(B%)=FNfixlen(data$(B%))
2480 PRINTTAB(inset%(type%(B%)),B%)data$(B%)
2490 ENDPROC
2500 :
2510 DEFPROCinsline
2520 FOR N%=max% TO B%+1 STEP-1
2530 data$(N%)=data$(N%-1)
2540 type%(N%)=type%(N%-1)
2550 style%(N%)=style%(N%-1)
2560 NEXT N%
2570 data$(B%)=clear$
2580 type%(B%)=1
2590 style%(B%)=1
2600 PROCtotlf
2610 PROCdisplay
2620 ENDPROC
2630 :
2640 DEFPROCdelline
2650 FOR N%=B% TO max%-1
2660 data$(N%)=data$(N%+1)
2670 type%(N%)=type%(N%+1)
2680 style%(N%)=style%(N%+1)
2690 NEXT N%
2700 data$(max%)=clear$
2710 PROCtotlf
2720 PROCdisplay
2730 ENDPROC
2740 :
2750 DEFPROCselect
2760 IF I%=130 AND style%(B%)<>3 type%(B%)=1
2770 IF I%=131 type%(B%)=2
2780 IF I%=132 type%(B%)=3
2790 IF I%=133 type%(B%)=4
2800 IF I%=134 style%(B%)=1
2810 IF I%=135 style%(B%)=2
2820 IF I%=140 AND type%(B%)<>1 style%(B%)=3
2830 PROCtotlf
2840 data$(B%)=FNfixlen(data$(B%))
2850 PROCdisplay
2860 A%=0:PRINT TAB(inset%(type%(B%)),B%);
2870 ENDPROC
2880 :
2890 DEFPROCmark
2900 VDU 28,0,24,2,2
2910 CLS
2920 FOR N%=0 TO maxlines%
2930 PRINT TAB(0,N%);type%(N%);" ";style%(N%);
2940 NEXT N%
2950 ENDPROC
2960 :
2970 DEFPROClabel
2980 totlfp%=0
2990 PROCpcode(71,-1)
3000 FORB%=0 TO maxlines%
3010 IF INKEY(-99) THEN PROCadjust
3020 IF abort%=TRUE B%=maxlines%+1:GOTO 3460
3030
3040 PROCpcode(53,-1)
3050 PROCpcode(45,ASC"0")
3060 PRINT TAB(pmargin%);
3070
3080 IF style%(B%)=2 PROCpcode(52,-1)
3090 IF style%(B%)=3 PROCpcode(45,1)
3100 ON type%(B%) GOTO 3130,3230,3310,3380
3110 :
3120
3130 PROCpcode(15,-2):
3140 PROCpcode(83,ASC"0"):
3150 PROCpcode(51,lf%(1)):
3160 totlfp%=totlfp%+lf%(1)
3170 PRINTdata$(B%)
3180 PROCpcode(84,-1):
3190 PROCpcode(18,-2):
3200 GOTO3460
3210 :
3220
3230 PROCpcode(15,-2):
3240 PROCpcode(51,lf%(2)):
3250 totlfp%=totlfp%+lf%(2)
3260 PRINTdata$(B%)
3270 PROCpcode(18,-2):
3280 GOTO3460
3290 :
3300
3310 PROCpcode(69,-1):
3320 PROCpcode(51,lf%(3)):
3330 totlfp%=totlfp%+lf%(3)
3340 PRINTdata$(B%)
3350 PROCpcode(70,-1):
3360 GOTO3460
3370 :
3380
3390 PROCpcode(69,-1):
3400 PROCpcode(87,1):
3410 PROCpcode(51,lf%(4)):
3420 totlfp%=totlfp%+lf%(4)
3430 PRINTdata$(B%)
3440 PROCpcode(70,-1):
3450 PROCpcode(87,ASC"0"):
3460 NEXT B%
3470 ENDPROC
3480 :
3490 DEFPROCpcode(a%,b%):IFb%>-2:VDU27
3500 VDU a%:IFb%>-1:VDUb%
3510 ENDPROC
3520 :
3530 DEFPROCadjust
3540 *FX3,4
3550 VDU 7
3560 REPEAT UNTIL NOT INKEY(-99)
3570 *FX21
3580 CLS
3590 PROCtitle
3600 INPUT'"Abort? Y/N "q$:IF q$="Y" OR q$="y" THEN abort%=TRUE:ENDPROC
3610 PRINT'"Printer margin is ";pmargin%
3620 REPEAT
3630 INPUT'"New margin: "pmargin$
3640 IF pmargin$="" THEN exit%=TRUE
3650 pmargin%=VAL(pmargin$)
3660 UNTIL (pmargin%>=0 AND pmargin% <100) OR exit%
3670 exit%=FALSE
3680 CLS:PROCtitle
3690 PRINT TAB(0,8)"Printing label ";P%;" of ";nlabels%
3700 *FX3,10
3710 ENDPROC
3720 :
3730 DEFPROCtotlf
3740 REPEAT
3750 PROCcount
3760 IF totlf%< height% maxlines%=maxlines%+1:GOTO3780
3770 IF totlf%> height% maxlines%=maxlines%-1
3780 UNTIL totlf%<=height% AND totlf%>height%-30
3790 PROCcount
3800 ENDPROC
3810 :
3820 DEFPROCcount
3830 totlf%=0
3840 FOR N%=0 TO maxlines%
3850 totlf%=totlf%+lf%(type%(N%))
3860 NEXT N%
3870 ENDPROC
3880 :
3890 DEFPROCprint
3900 abort%=FALSE
3910 PROCtitle
3920 INPUT'TAB(8)"Enter number of labels "nlabels%
3930 IFnlabels%=0 ENDPROC
3940 PRINT'"Hold SPACE to adjust/abort"
3950 VDU2:FOR P%=1 TO nlabels%
3960 IF abort%=TRUE P%=nlabels%+1:GOTO4020
3970 *FX3,4
3980 PRINT TAB(0,8)"Printing label ";P%;" of ";nlabels%
3990 *FX3,10
4000 PROClabel
4010 PROCpcode(74,pitch%-totlf%):
4020
4030 NEXT P%:*FX3
4040 VDU3:ENDPROC
4050 :
4060 DEFPROCcursor
4070 VDU 23;10,3*(4-type%(B%));0;0;0;
4080 ENDPROC
4090 :
4100 *FX3
4110 VDU3:IF ERR=17 GOTO120
4120 MODE7:REPORT:PRINT" at line ";ERL
4130 X=GET:GOTO120
4140 :
4150 DEFFNfixlen(line$)
4160 REPEAT
4170 line$=line$+" "
4180 UNTIL LEN line$>len%(type%(B%))
4190 line$=LEFT$(line$,len%(type%(B%)))
4200 =line$
4210 DEFPROCos:*FX4
4220 REPEAT
4230 INPUTLINE"*"line$:OSCLIline$
4240 UNTILline$="":*FX4,1
4250 ENDPROC