8-Bit Software Online Conversion
Addresses. Overlay Program - Listing
10REM "ADDRESS" by Douglas Ambrose, J
anuary 1995
20REM Uses overlay procedure - see Ac
orn User Nov 1983 p.67.
30REM Written for three DATA blocks (
i.e. files - DAT1, DAT2, DAT3)
40REM Enter ten items for each entry
on DATA lines as follows:
50REM number of members for entry (ne
gative for guests) [num%],Name [name$],
60REM five components of address incl
uding postcode (ad$),
70REM telephone number [phone$],date
sub paid [date$],amount of sub [sub$],
80REM A(nnual) or L(ife) [AorL$]. Eac
h DATA block ends with "100"
90REM Put adjacent commas if item is
blank or "0" for unpaid sub.
100REM Original program published in B
eebug Vol.9 (9) p.10 (1991).
110MODE3
120C%=TOP:LOMEM=TOP+&1000
130ON ERROR GOTO 350
140DIM name$(3),ad$(15)
150C1$="Kingston upon Thames":C2$="Sur
biton":C3$="Kingston"
160PROCclear:PROCchoice
170IF J%=1 PRINT"Press any key after e
ach row of labels has been printed"
180IF H%=-1 VDU15:VDU2
190REPEAT
200B%=B%+1:A%=0
210IF B%=1 f$="DAT1"
220IF B%=2 f$="DAT2"
230IF B%=3 f$="DAT3"
240PROCovly(f$)
250RESTORE
260IF J%=1 PROClabel
270IF J%>1 PROClist
280UNTIL B%=3
290IF J%=5 PROCclear:END
300IF J%=1 VDU3:PRINT"Number of addres
sees "K%'"Number of labels "M%
310IF J%>2 AND H%=-1 PRINT"Press any k
ey for summary":A=GET
320IF J%>1 PROCtot
330PROCclear:END
340
350PROCclear:REPORT:PRINT" at line ";E
RL:END
360
1000DEF PROCchoice
1010PRINT"PRINTER ON?":H%=(CHR$(GET AND
&DF)="Y"):REM "y" also
1020PRINT
1030PRINT"LABELS
(1) ?"
1040PRINT"COUNT
(2) ?"
1050PRINT"LIST MEMBERS WITH ADDRESSES
(3) ?"
1060PRINT"LIST MEMBERS WITHOUT ADDRESSE
S (4) ?"
1070PRINT"LIST MEMBERS NOT PAID ONLY
(5) ?"
1080PRINT
1090PRINT" TYPE NUMBER OF CHOI
CE"
1100J%=GET-48
1110ENDPROC
1120
1130DEF PROClist
1140REPEAT PROCreadlist:IF J%=2 GOTO 11
60
1150PROCprintlist
1160UNTIL A%=1
1170REMIF J%=5 ENDPPROC
1180REMIF B%=3 AND J%<>2 AND H%=-1 A=GE
T
1190ENDPROC
1200
1210DEF PROCtot
1220PRINT
1230PRINTTAB(54)"Subs"
1240PRINTTAB(52)"collected"
1250PRINTTAB(56)"#"
1260PRINTTAB(15)"Annual members"TAB(35)
STR$P%TAB(55)STR$T%
1270PRINTTAB(15)"Life members"TAB(35)ST
R$L%TAB(45)STR$(P%+L%)TAB(55)STR$V%
1280PRINTTAB(15)"Yet to pay"TAB(45)STR$
(K%-P%-L%-F%)
1290PRINTTAB(15)"Nominal Membership",TA
B(45)STR$(K%-F%):PRINT
1300PRINTTAB(15)"Guest members",TAB(45)
STR$F%
1310PRINTTAB(15)"Total of list"TAB(45)S
TR$(K%)TAB(55)STR$(T%+V%):PRINT
1320PRINTTAB(15)"Number of names"TAB(45
)STR$M%
1330PRINT:ENDPROC
1340
1350DEF PROCreadlist
1360A%=0:READ num%:IF num%>=100 num%=0:
A%=1:ENDPROC
1370IF num%<0 num%=-num%:F%=F%+num%
1380K%=K%+num%:M%=M%+1
1390READ name$,ad$(1),ad$(2),ad$(3),ad$
(4),ad$(5)
1400READ phone$,date$,sub$,AorL$:S%=VAL
(sub$)
1410IF AorL$="L" AorL$="Life"
1420IF AorL$="Life" AND sub$="0" sub$="
"
1430IF AorL$="Life":V%=V%+S%:L%=L%+num%
1440IF AorL$="A" AorL$="Annual"
1450IF AorL$="Annual" AND sub$="0" sub$
=""
1460IF AorL$="Annual" AND sub$="" AorL$
="NOT PAID"
1470IF AorL$="Annual" T%=T%+S%:IF S%>0
P%=P%+num%
1480IF AorL$="F" AorL$="Free":sub$=""
1490ENDPROC
1500
1510DEF PROCprintlist
1520IF A%=1 ENDPROC
1530IF J%=5 AND AorL$<>"NOT PAID" ENDPR
OC
1540IF ad$(2)="K" ad$(2)=C3$ ELSEIF ad$
(3)="K" ad$(3)=C3$ ELSEIF ad$(4)="K" ad$
(4)=C3$
1550IF ad$(2)="S" ad$(2)=C2$ ELSEIF ad$
(3)="S" ad$(3)=C2$ ELSEIF ad$(4)="S" ad$
(4)=C2$
1560@%=&15:PRINTTAB(8)name$;
1570@%=&0A:PRINTTAB(40)phone$TAB(50)Aor
L$;:@%=&03:PRINTTAB(58)sub$;
1580@%=&0A:PRINTTAB(62)date$;:E%=E%+1:I
F J%=5 GOTO 1600
1590@%=&03:PRINTTAB(72)K%
1600IF J%=4 OR J%=5 GOTO 1670
1610IF ad$(1)=""PRINTTAB(12)"Address no
t known":GOTO 1670
1620IF ad$(2)=""PRINTTAB(12)ad$(1):GOTO
1670
1630IF ad$(3)=""PRINTTAB(12)ad$(1)","ad
$(2):GOTO 1670
1640IF ad$(4)=""PRINTTAB(12)ad$(1)","ad
$(2)","ad$(3):GOTO 1670
1650IF ad$(5)=""PRINTTAB(12)ad$(1)","ad
$(2)","ad$(3)","ad$(4):GOTO 1670
1660PRINTTAB(12)ad$(1)","ad$(2)","ad$(3
)","ad$(4)","ad$(5)
1670E%=E%+1:IF E%>=55 AND H%=-1 PRINT"P
ress any key":A=GET:E%=0
1680*FX15,1
1690ENDPROC
1700
1710DEF PROClabel
1720VDU15:REPEAT
1730FOR I%=1 TO 15:ad$(I%)="":NEXT:FOR
I%=1 TO 3:name$(I%)="":NEXT
1740A%=0:FOR I%=1 TO 12 STEP 5
1750READ num%:IF num%>=100 num%=0:A%=1:
IF I%=1 ENDPROC
1760IF A%=1 GOTO 1820
1770IF num%<0 num%=-num%
1780K%=K%+num%:M%=M%+1:READ name$(I%/4+
3/4)
1790READ ad$(I%),ad$(I%+1),ad$(I%+2),ad
$(I%+3),ad$(I%+4)
1800READ phone$,date$,sub$,AorL$
1810NEXT
1820FOR I%=2 TO 12 STEP 5
1830IF ad$(I%)="K" ad$(I%)=C1$
1840IF ad$(I%)="S" ad$(I%)=C2$
1850IF ad$(I%+1)="K" ad$(I%+1)=C1$
1860IF ad$(I%+1)="S" ad$(I%+1)=C2$
1870IF ad$(I%+2)="K" ad$(I%+2)=C1$
1880IF ad$(I%+2)="S" ad$(I%+2)=C2$
1890NEXT
1900PRINT
1910PRINTTAB(2)name$(1) TAB(30)name$(2)
TAB(58)name$(3)
1920FOR I%=1 TO 5
1930PRINTTAB(2)ad$(I%) TAB(30)ad$(I%+5)
TAB(58)ad$(I%+10)
1940NEXT
1950PRINT:PRINT:A=GET
1960UNTIL A%=1
1970ENDPROC
1980
1990DEF PROCovly(f$):LOCAL X%,Y%
2000DIM X%-1:Y%=X%DIV&100
2010$X%="LOAD "+f$+" "+STR$รท(C%-2)
2020CALL &FFF7
2030ENDPROC
2040
2050DEF PROCclear
2060?(C%-1)=&FF:REM Removes appended DA
TA.
2070B%=0:E%=0:F%=0:H%=0:J%=0:K%=0:L%=0:
M%=0:P%=0:S%=0:T%=0:V%=0
2080VDU3:PRINT:PRINT "CLEAR":VDU14:ENDP
ROC
2090REM B%=marker for data blocks, E%=l
ine counter, H%=print marker
2100REM J%=number in PROCchoice, K%=tot
al of list, L%=number of life
2110REM members, M%=no. of labels, num%
=no. of each entry, negative
2120REM for guest members, P%=number of
paid annual members
2130REM S%,T%(annual),V%(life)=subscrip
tions collected
2140
2150DEF FNN="ADDRESS"