     rem This is the mailing label printing program.

%INCLUDE ALL.BAS
     RESTORE
1000 DIM K$(14),N(2,14)
1020 DIM A$(5),B$(5),C$(5),DA$(5),E$(5),F$(5)
      for z=3 to 8:read n(0,z):next z
     data 24,24,24,17,2,5
     print clear$:print
1050 PRINT
1060 PRINT "THIS IS THE MAILING LABEL PRINTING ROUTINE."
1070 PRINT 
1080 PRINT "IF YOU ARE NOT FAMILIAR WITH ITS OPERATION, PLEASE"
1090 PRINT "READ THE INSTRUCTIONS BEFORE PROCEEDING."
1100 PRINT:PRINT
     print "Enter the name of the mailing list file, i.e. MA0."
     input line z5$
     if len(z5$)>8 then 1100
     z5$="b:"+z5$:z7$=z5$+"size"
     print
1110 INPUT"HOW MANY LABELS ACROSS THE PAGE  (1 TO 5)";M
1120 PRINT:PRINT
1125 PRINT "INDICATE THE DISTANCE BETWEEN THE LEFT EDGES OF"
1130 PRINT "ANY TWO LABELS IN DECIMAL INCHES (I.E. 2.6)."
1135 INPUT K
1140 K=(K*10)+1
1142 IF M=1 THEN 1146
1145 IF K<25 THEN PRINT "*** LABEL TO SHORT ***":GOTO 1125
1146 IF K>110 THEN PRINT "*** LABEL TO LONG ***":GOTO 1125
1150 PRINT:PRINT
1160 PRINT "INDICATE THE NUMBER OF SPACES BETWEEN LABELS (I.E. 2)."
1165 INPUT L
2000 IF M<1 OR M>5 THEN 1110
     if end #1 then 1100
     print clear$:print:print
2030 open z7$ as 1:read #1;z2,z3:close 1:z2=z2-1:z3=z3-2
2150 PRINT "LABELS TO PRINT ";Z2
2160 PRINT
3000 NA=INT(Z2/M)+1
3004 N(0,9)=14:N(0,10)=11:N(0,11)=8:N(0,12)=8:N(0,13)=1
3010 Z1=0
3020 open z5$ recl 150 as 1
3025 lprinter
3030 FOR J=1 TO NA
3035 Z5=0
3040 FOR I=1 TO M
     read #1,z1+1;n(2,1),n(2,2),n$
3055 Z9=1:FOR Z=3 TO 13:K$(Z)=MID$(N$,Z9,N(0,Z)):Z9=Z9+N(0,Z):NEXT Z
3060 A$(I)=K$(3)
3070 B$(I)=K$(4)
3080 C$(I)=K$(5)
3090 DA$(I)=LEFT$(K$(6),15)
4000 E$(I)=K$(7)
4010 F$(I)=K$(8)
4020 Z1=Z1+1
4025 Z5=Z5+1
4027 IF Z1=Z2 THEN 4040
4030 NEXT I
4040 FOR I=1 TO Z5-1
4045 IF Z5=1 THEN print TAB(K);:GOTO 4070
4050 print A$(I);TAB((I*K)-I+1);
4060 NEXT I
4070 print A$(Z5)
4080 FOR I=1 TO Z5-1
4085 IF Z5=1 THEN print TAB(K);:GOTO 5010
4090 print B$(I);TAB((I*K)-I+1);
5000 NEXT I
5010 print B$(Z5)
5020 FOR I=1 TO Z5-1
5025 IF Z5=1 THEN print TAB(K);:GOTO 5050
5030 print C$(I);TAB((I*K)-I+1);
5040 NEXT I
5050 print C$(Z5)
5060 FOR I=1 TO Z5-1
5065 IF Z5=1 THEN print TAB(K);:GOTO 6000
5070 print DA$(I);",";E$(I);" ";
5080 print F$(I);TAB((I*K)-I+1);
5090 NEXT I
6000 print DA$(Z5);",";E$(Z5);" ";F$(Z5)
6010 FOR Z=1 TO L:print:NEXT Z
6030 NEXT J
6040 close 1
6045 console
6050 PRINT clear$
6060 chain "master6"
