8-Bit Software Online Conversion
SYSTEMS call costing - Listing
10REM" *** SYSTEMS communications ***
"
20REM" *** phone call monitoring ***
"
30REM" *** system version 1a ***
"
40REM" *** Duncan Webster Jun 90 ***
"
50REM" *** PUBLIC DOMAIN SOFTWARE ***
"
60:
70MODE6:*FX220
80PROCA:PROCB:REPEAT:ONERRORPROCC("SY
STEM ERROR - CONTACT DUNCAN WEBSTER")
90*FX15
100PROCD:INPUTTAB(0,24);"READY "A$:PRO
CE:IFA$="AMD DF"PROCF:UNTILFALSE
110IFA$="ADD"PROCG:UNTILFALSE
120IFA$="SHW CG"PROCH:UNTILFALSE
130IFA$="AMD CG"PROCI:UNTILFALSE
140IFA$="OTH"PROCJ:UNTILFALSE
150IFA$="SHW ST"PROCK:UNTILFALSE
160IFA$="PRT ST"PROCL:VDU3:UNTILFALSE
170IFA$="DEL"PROCM:UNTILFALSE
180IFA$="COM"PROCN:UNTILFALSE
190PROCC("INVALID COMMAND INPUT"):UNTI
LFALSE
200DEFPROCB:CLS:PRINT"SYSTEMS Communic
ations VERSION 1a":PRINT"Duncan Webster
June 1990":PRINT"(phone cost management)
":ENDPROC
210DEFPROCD:VDU23,0,10,64;0;0;0;:ENDPR
OC
220DEFPROCE:VDU23;8202;0;0;0;:ENDPROC
230DEFPROCO:TIME=0:REPEATUNTILTIME>100
:ENDPROC
240DEFPROCP:TIME=0:REPEATUNTILTIME>50:
ENDPROC
250DEFPROCA:CLS:PROCB:PROCD:PRINTTAB(0
,4)"DATAFILE NAME ";:INPUT""B$:IFB$=""PR
OCQ:ENDPROC
260INPUTTAB(0,5)"DISC DRIVE NO "C$:IFC
$<>"0"ANDC$<>"1"ANDC$<>"2"ANDC$<>"3"ANDC
$<>"X"PROCR(14,5,10):GOTO260
270IFC$="X"GOTO290
280OSCLI("DRIVE "+C$):PROCE
290B=OPENINB$:CLOSE#B:IFB=0PROCC("DATA
FILE DOES NOT EXIST"):CLEAR:RUN
300D$=B$:PROCE:ENDPROC
310DEFPROCR(`%,£%,a%):PRINTTAB(`%,£%);
SPCa%:ENDPROC
320DEFPROCC(E$):CLS:VDU7:PROCE:PRINTTA
B(0,13);E$:PROCO:IFE$="SYSTEM ERROR - CO
NTACT DUNCAN WEBSTER"F$=GET$:IFF$="R"CLS
:PRINT"SYSTEM ERROR REPORT"'':REPORT:PRI
NT;" ERROR"''"Line Number ";ERL''"CONTAC
T DUNCAN WEBSTER ON RESOLVE"''"Telephone
= 0582 832653"ELSEENDPROC
330ENDPROC
340DEFPROCQ
350CLS:PRINT"NEW DATAFILE RECORD":PRIN
T':PROCD:INPUT"DATAFILE NAME "F$:PROCE:
IFLENF$>7GOTO350
360B=OPENINF$:CLOSE#B:IFB<>0PROCC("DAT
AFILE ALREADY EXISTS"):CLEAR:RUN
370PROCD:INPUT" USERS NAME "G$:INPU
T" ADDRESS 1 "H$:INPUT" ADDRESS 2
"I$:INPUT" ADDRESS 3 "J$:INPUT"
ADDRESS 4 "K$:INPUT" ADDRESS 5 "L$
:INPUT" POSTCODE "M$:INPUT"
AREA "N$:INPUT" PHONE NO "O$:INPU
T" CUSTOMER REF "P$:INPUT'" CORREC
T "Q$
380IFQ$<>"Y"ANDQ$<>"y"GOTO350
390PROCE:PROCS:B=OPENOUTF$:PRINT#B,G$,
H$,I$,J$,K$,L$,M$,N$,O$,P$:CLOSE#B:B=OPE
NOUT"CHARGES":PRINT#B,"L",0,0,0:PRINT#B,
"A",0,0,0:PRINT#B,"B",0,0,0:PRINT#B,"B1"
,0,0,0:PRINT#B,"M",0,0,0:CLOSE#B:PROCT:P
ROCO:CLS:PRINT"Re Booting System ...":B$
=F$:PROCU:PROCT:PROCO:ENDPROC
400DEFPROCS:PRINTTAB(0,1);"Recording
":ENDPROC
410DEFPROCT:PRINTTAB(0,1);"Accepted
":ENDPROC
420DEFPROCV:PRINTTAB(0,1);"Processing
Occurring ":ENDPROC
430DEFPROCU:B=OPENINB$:INPUT#B,R$,S$,T
$,U$,V$,W$,X$,Y$,Z$,`$:CLOSE#B:ENDPROC
440DEFPROCW:INPUT#B,£$,a$,b$,c$,d$:END
PROC
450DEFPROCX:PRINTTAB(0,1);SPC29:ENDPRO
C
460DEFPROCY:PRINT#C,£$,a$,b$,c$,d$:END
PROC
470DEFPROCF:CLS:PRINT"AMEND INFORMATIO
N DATAFILE":PROCV
480PROCU:PROCX:PROCO:PRINT'':PRINTTAB(
0,5);" USERS NAME "R$:PRINT" ADDRE
SS 1 "S$:PRINT" ADDRESS 2 "T$:PRINT
" ADDRESS 3 "U$:PRINT" ADDRESS 4
"V$:PRINT" ADDRESS 5 "W$:PRINT"
POSTCODE "X$:PRINT" AREA "Y$:
PRINT" PHONE NO "Z$:PRINT" CUSTOMER
REF "`$:R$=FNA(15,5,24,R$)
490S$=FNA(15,6,24,S$):T$=FNA(15,7,24,T
$):U$=FNA(15,8,24,U$):V$=FNA(15,9,24,V$)
:W$=FNA(15,10,24,W$):X$=FNA(15,11,24,X$)
:Y$=FNA(15,12,24,Y$):Z$=FNA(15,13,24,Z$)
:`$=FNA(15,14,24,`$):PROCD:PRINTTAB(0,16
);" CONFIRM ";:INPUT""Q$:PROCE
500IFQ$<>"Y"ANDQ$<>"y"CLS:PRINT"AMEND
INFORMATION DATAFILE":GOTO480
510PROCS:PROCO:B=OPENOUTB$:PRINT#B,R$,
S$,T$,U$,V$,W$,X$,Y$,Z$,`$:CLOSE#B:PROCT
:ENDPROC
520DEFFNA(`%,£%,a%,e$):f$="":PROCD:INP
UTTAB(`%,£%);""f$:IFf$=""f$=e$
530IFf$="@"f$=""
540PROCE:PROCR(`%,£%,a%):PRINTTAB(`%,£
%);f$:=f$
550DEFFNB(£%,a%)
560g$="":INPUTTAB(£%,a%);""f$:IFf$=""T
HEN=f$
570IFVALf$>99999PROCR(£%,a%,20):GOTO56
0
580b%=VALf$:IFLENf$=1THENg$=("0.0"+f$)
590IFLENf$=2THENg$=("0."+f$)
600IFLENf$>2THENe$=RIGHT$(f$,2):h$=LEF
T$(f$,(LENf$-2)):g$=h$+"."+e$
610PRINTTAB(£%,a%);"";:=g$
620DEFFNC(f$):IFLENf$=1THENg$=("0.0"+f
$)
630IFLENf$=2THENg$=("0."+f$)
640IFLENf$>2THENe$=RIGHT$(f$,2):h$=LEF
T$(f$,(LENf$-2)):g$=h$+"."+e$
650=g$
660DEFPROCG
670CLS:PROCD:i$="":d$="":PRINT"REGISTE
R PHONE CALL COST":PRINT:PRINTTAB(0,3);"
DATE ";TAB(0,4);" DISTANCE ";TA
B(0,5);" RATE ";TAB(0,6);" TI
ME ";TAB(0,7);" COST ";TAB(0,9);"
REFERENCE:"
680INPUTTAB(12,3);""£$:IF£$=""GOTO680
690IFLEN£$>7GOTO680
700INPUTTAB(12,4);""j$:IFj$<>"B"ANDj$<
>"L"ANDj$<>"A"ANDj$<>"M"ANDj$<>"B1"ANDj$
<>""PROCR(12,4,20):GOTO700
710IFj$="B"PRINTTAB(14,4);"(national a
bove 56km)"
720IFj$="A"PRINTTAB(14,4);"(outside lo
cal up to 56km)"
730IFj$="L"PRINTTAB(14,4);"(local)"
740IFj$="B1"PRINTTAB(15,4);"(low cost
national)"
750IFj$="M"PRINTTAB(14,4);"(mobile pho
ne rate)"
760INPUTTAB(12,5);""k$:IFk$<>"C"ANDk$<
>"S"ANDk$<>"P"ANDk$<>""PROCR(12,5,20):GO
TO760
770IFk$="C"PRINTTAB(14,5);"(cheap 6pm-
8am & Sat/Sun)"
780IFk$="S"PRINTTAB(14,5);"(Standard 8
am-9am 1pm-6pm)"
790IFk$="P"PRINTTAB(14,5);"(Peak 9am-1
pm)"
800INPUTTAB(12,6);""l$:IFVALl$<1ANDl$<
>""PROCR(12,6,20):GOTO800
810IFl$=""GOTO830
820PRINTTAB(13+LENl$,6);"Minutes"
830PRINTTAB(12,7);FNB(12,7):m$=g$:PROC
E:PROCZ:IFn$="INVALID"PROCC("INSUFFICIEN
T DETAILS - PLEASE RE-INPUT"):ENDPROC
840IFn$="AUTOCOST"PROC`ELSEGOTO870
850IFo$<>j$ENDPROC
860IFc%=0ORd%=0ORe%=0PROCC("CHARGE FIL
E INCOMPLETE"):ENDPROC
870PROCD:INPUTTAB(0,10);""`$:IFLEN`$>3
9PROCR(0,10,(LEN`$)):GOTO870
880INPUTTAB(0,12);" CORRECT: "Q$:IFQ$
="E"PROCC("COMMAND ABANDONED"):ENDPROC
890IFQ$<>"Y"ANDQ$<>"y"GOTO670
900PROCE:PROCV:B=OPENUP"STATEMT":IFB=0
CLOSE#B:B=OPENOUT"STATEMT":GOTO930
910IFEOF#BGOTO930
920REPEATINPUT#B,p$,q$,r$,f$,d$:UNTILE
OF#B
930`%=VALd$:`%=`%+b%:d$=STR$`%:PRINT#B
,£$,i$,`$,STR$b%,d$:CLOSE#B:PROCT:ENDPRO
C
940DEFPROCZ:IF£$=""n$="INVALID":ENDPRO
C
950IFm$<>""n$="MANUAL":ENDPROC
960IFj$=""ORk$=""ORl$=""n$="INVALID"EL
SEn$="AUTOCOST"
970ENDPROC
980DEFPROC`:PROCV:B=OPENIN"CHARGES":RE
PEATINPUT#B,o$,c%,d%,e%:UNTILo$=j$OREOF#
B:CLOSE#B:IFo$<>j$PROCC("INVALID CHARGE
BAND"):ENDPROC
990IFc%=0ORd%=0ORe%=0ENDPROC
1000IFk$="C"f%=e%
1010IFk$="S"f%=d%
1020IFk$="P"f%=c%
1030IFo$="L"i$="LOC"
1040IFo$="A"i$="ART"
1050IFo$="B"i$="NAT"
1060IFo$="B1"i$="LCN"
1070IFo$="M"i$="MRT"
1080b%=f%*(VALl$):s$="":IFLEN(STR$b%)=1
THENm$="0.0"+STR$b%
1090IFLEN(STR$b%)=2THENm$="0."+STR$b%
1100IFLEN(STR$b%)>2 t$=STR$b%:u$=LEFT$(
t$,(LENt$-2)):v$=RIGHT$(t$,2):m$=u$+"."+
v$
1110PRINTTAB(12,7);m$:PROCX:ENDPROC
1120DEFPROCH:CLS:PRINT"ENQUIRY CHARGE G
RID":PROCV:B=OPENIN"CHARGES":PRINTTAB(0,
4);"DISTANCE PEAK/MIN STD/MIN CHP
/MIN":PRINTTAB(0,6);"Local";TAB(0,8);"A
Rate";TAB(0,10);"B Rate";TAB(0,12);"B1 R
ate";TAB(0,14);"M Rate":FORg%=6TO14STEP2
:INPUT#B,p$,£%,a%,h%:PRINTTAB(14,g%);£%;
"p";TAB(24,g%);a%;"p";TAB(34,g%);h%;"p":
NEXT
1130CLOSE#B:PROCT:ENDPROC
1140DEFPROCI:CLS:PRINT"AMEND CHARGE GRI
D"
1150PROCD:INPUTTAB(0,4);" DISTANCE BA
ND "w$:PROCE:IFw$<>"L"ANDw$<>"A"ANDw$<>
"B"ANDw$<>"B1"ANDw$<>"M"PROCR(19,4,20):G
OTO1150
1160PROCV:B=OPENIN"CHARGES":C=OPENOUT"N
EW":REPEATINPUT#B,p$,£%,a%,h%:IFp$=w$PRO
CX:PROC£
1170PROCV:PRINT#C,p$,£%,a%,h%:UNTILEOF#
B:CLOSE#B:CLOSE#C:*DELETE CHARGES
1180*RENAME NEW CHARGES
1190PROCT:ENDPROC
1200DEFPROC£:PRINTTAB(0,5);"
PEAK "£%:PRINTTAB(0,6);" STANDA
RD "a%:PRINTTAB(0,7);" CHEAP
"h%:PROCD:INPUTTAB(18,5);""i%:IFi%<1THE
Ni%=£%
1210PROCR(18,5,15):PRINTTAB(18,5);i%:IN
PUTTAB(18,6);""j%:IFj%<1THENj%=a%
1220PROCR(18,6,15):PRINTTAB(18,6);j%:IN
PUTTAB(18,7);""k%:IFk%<1THENk%=h%
1230PROCR(18,7,15):PRINTTAB(18,7);k%:PR
OCE:£%=i%:a%=j%:h%=k%:ENDPROC
1240DEFPROCJ
1250CLS:PRINT"REGISTER OTHER CHARGES":P
RINT:PROCD
1260INPUTTAB(0,4);" DATE "£$:IF£$
=""GOTO1260
1270IFLEN£$>7GOTO1260
1280PRINTTAB(0,5);" AMOUNT "FNB(12,
5):c$=f$:IFVALc$=0PROCR(12,5,20):GOTO128
0
1290PRINTTAB(0,7);"REFERENCE:"
1300INPUTTAB(0,8);""`$:IFLEN`$>39PROCR(
0,8,LEN`$):GOTO1300
1310INPUTTAB(0,10);" CORRECT: "Q$:IFQ
$="E"CLOSE#0:ENDPROC
1320IFQ$<>"Y"ANDQ$<>"y"GOTO1250
1330PROCE:PROCV:B=OPENUP"STATEMT":IFB=0
CLOSE#B:B=OPENOUT"STATEMT":GOTO1360
1340IFEOF#BGOTO1360
1350REPEATINPUT#B,x$,y$,z$,AA$,BA$:UNTI
LEOF#B
1360l%=VALBA$:m%=VALc$:n%=l%+m%:d$=STR$
n%:PRINT#B,£$,"OTH",`$,c$,d$:CLOSE#B:PRO
CT:ENDPROC
1370DEFPROCK:CLS:PRINT"ENQUIRY STATEMEN
T":PROCV:PRINT"DATE CODE REFERENCE
AMT BAL":g%=4:B=OPENIN"STATEMT":I
FB=0CLOSE#B:PROCC("STATEMENT FILE DOES N
OT EXIST"):ENDPROC
1380IFEOF#BCLOSE#B:PROCC("STATEMENT FIL
E EMPTY"):ENDPROC
1390PROCT:PROCO:REPEATPROCX:INPUT#B,x$,
y$,z$,AA$,BA$:PRINTTAB(0,g%);x$;TAB(8,g%
);y$;TAB(12,g%);LEFT$(z$,12);TAB(32-LEN(
FNC(AA$)),g%);FNC(AA$);TAB(40-LEN(FNC(BA
$)),g%);FNC(BA$):g%=g%+1:IFg%>20THENg%=4
:PRINTTAB(0,23);"PRESS RETURN":A=GET:CLS
:PRINT"ENQUIRY STATEMENT":PROCV
1400UNTILEOF#B:CLOSE#B:ENDPROC
1410DEFPROCM:CLS:PRINT"CLOSE STATEMENT"
:VDU7:PRINTTAB(0,4);"*** MAKE SURE STATE
MENT PRINTED ***":PRINT:PROCD:INPUTTAB(0
,6);"CONFIRM DELETION "Q$:PROCE:IFQ$="E
"ENDPROC
1420IFQ$<>"YES"ANDQ$<>"yes"ANDQ$<>"Yes"
PROCC("CONFIRMATION FAILED"):ENDPROC
1430PROCV:PRINTTAB(0,8);"WAIT - *** DEL
ETING STATEMENT ***":OSCLI"DELETE STATEM
T":PROCT:ENDPROC
1440DEFPROCL:CLS:PRINT"PRINT STATEMENT"
:PRINTTAB(0,4);"*** LOAD PRINTER ***":PR
OCD:INPUTTAB(0,6);"CONFIRM "Q$:PROCE:IF
Q$="E"ENDPROC
1450IFQ$<>"YES"ANDQ$<>"yes"ANDQ$<>"Yes"
PROCC("CONFIRMATION FAILED"):ENDPROC
1460PROCV:PRINTTAB(0,8);"*** OPENING ST
ATEMENT FILE ***":B=OPENIN"STATEMT":IFB=
0CLOSE#B:PROCC("STATEMENT FILE DOES NOT
EXIST"):ENDPROC
1470IFEOF#BCLOSE#B:PROCC("STATEMENT FIL
E EMPTY"):ENDPROC
1480PROCT:PROCP:PROCX:PROCP:PROCV:PRINT
TAB(0,10);"*** OPENING SYSTEM DATAFILE *
**":C=OPENIND$:IFC=0CLOSE#0:PROCC("DATAF
ILE DOES NOT EXIST"):ENDPROC
1490PROCP:PROCT:PROCP:PROCX:PROCP:PROCV
:INPUT#C,R$,S$,T$,U$,V$,W$,X$,Y$,Z$,`$:C
LOSE#C:PROCT:PROCO:PROCV:PRINTTAB(0,12);
"*** PRINTING STATEMENT ***":*FX15,10
1500*FX15
1510VDU2:VDU21:FORD=0TO6:PRINTSPC20:NEX
T:PRINT"SYSTEMS communications VERSION 1
a (c) Duncan Webster":PRINT"(customised
for phone call charge calculations)":PRI
NT:PRINT:PRINTR$:PRINTS$:PRINTT$:PRINTU$
:IFV$<>""PRINTV$
1520IFW$<>""PRINTW$
1530IFX$<>""PRINTX$
1540PRINT:PRINT:PRINT"AREA: ";Y$;" PHON
E NUMBER: "Z$:PRINT"Statement of Phone C
harges REFERENCE: ";`$:PRINT"(to and fro
m dates as on this statement)":PRINT:PRI
NT"DATE CODE REFERENCE
AMOUNT BALANCE
"
1550PRINT"`````````````````````````````
````````````````````````````````````````
````````":PRINT:REPEATINPUT#B,CA$,DA$,EA
$,FA$,GA$:PRINTTAB(0);CA$;TAB(9);DA$;TAB
(15);EA$;TAB(60-LEN(FNC(FA$)));FNC(FA$);
TAB(75-LEN(FNC(GA$)));FNC(GA$):UNTILEOF#
B:CLOSE#B:PRINT:PRINT"TRANSACTION CODES
EXPLANATION":PRINT
1560PRINT"NAT - National B Rate Phone C
all Over 56km":PRINT"LOC - Local L Rate
Phone Call (no dialling code)":PRINT"LCN
- Low Cost National B1 Rate Call (over
56km)":PRINT"MRT - Mobile M Rate Phone C
all (ie 0898 Numbers)"
1570PRINT"ART - Outside Local A Rate ca
ll (within 56km - local codes)":PRINT"OT
H - Other User Created Transaction":FORD
=0TO600:PRINT" ";:NEXT:VDU3:*FX15
1580VDU3:VDU6:PROCT:ENDPROC
1590DEFPROCN:CLS:PRINT"ENQUIRY COMMAND
LIST":PRINT':PRINT"AMD DF - Amend Datafi
le Default Values":PRINT"ADD - Add Co
st Item to Statement":PRINT"SHW CG - Dis
play Charge Grid":PRINT"AMD CG - Amend C
harge Grid":PRINT"OTH - Add Miscellan
eous to Statement"
1600PRINT"SHW ST - Statement (screen on
ly)":PRINT"PRT ST - Full Statement (prin
ter)":PRINT"DEL - Delete Phone Statem
ent":ENDPROC