8-Bit Software Online Conversion
Simple Database (3 Field) - Listing
10DEFFNS="TotDB"
20MODE7
30VDU23;8202;0;0;0;
40*FX4,1
50B%=10
60ONERROR F%=OPENOUT"Data":PRINT#F%,"
000.00":PRINT#F%,"000.00":PRINT#F%,"....
..............":CLOSE#F%
70F%=OPENUP"Data"
80PROCread
90ONERROR CLOSE#F%:OSCLI"FX4":REPORT:
PRINTERL:END
100REPEAT
110PROCscreen
120PROCinput
130IF A%=64 PROCprintout
140IF A%>64 IF A%<123 IF B%=10 PROCdon
ame
150IF A%>44 IF A%<58 IF B%<>10 PROCdot
ot
160UNTILFALSE
170END
180DEFPROCscreen
190PRINTTAB(0,2);
200PRINT" Simple Database By C.J.Ric
hardson"
210PRINT" Arrow Keys to Move Between
Records"
220PRINT" @ For Printout"
230PRINT" ESCAPE to Finish"
240PRINTTAB(14,8);" Record ";PTR#F%/36
;" "
250PRINTTAB(5,10);" Name ";Nam
e$;" "
260PRINTTAB(5,12);" Total Spent £";Tot
1$;" "
270PRINTTAB(5,14);" Amount Owed £";Tot
2$;" "
275PRINTTAB(3,20);" Disc must NOT be w
rite protected."
280VDU31,4,10,32,10,10,8,32,10,10,8,32
,31,3,B%,132,157
290ENDPROC
300DEFPROCinput
310*FX21
320IF N%=0 A%=GET ELSE A%=N%
330N%=0
340IF A%=136 OR A%=137 PROCnextrecord:
A%=0
350IF A%=138 B%=B%+2:A%=0:IF B%=16 B%=
10
360IF A%=139 B%=B%-2:A%=0:IF B%=8 B%=1
4
370ENDPROC
380DEFPROCnextrecord
390IFA%=136 IF PTR#F%>36:PTR#F%=PTR#F%
-(36*2) ELSE IF A%=136:PTR#F%=0
400IFA%=137 IF PTR#F%=EXT#F%:VDU7:PRIN
TTAB(15,8)"New Record":PRINT#F%,"000.00"
:PRINT#F%,"000.00":PRINT#F%,"...........
.......":PTR#F%=PTR#F%-36
410PROCread
420ENDPROC
430DEFPROCread
440INPUT#F%,Tot1$
450INPUT#F%,Tot2$
460INPUT#F%,Name$
470ENDPROC
480DEFPROCdoname
490VDU31,19,B%
500PRINTSPC(18)
510VDU31,19,B%,A%
520Name$=CHR$(A%)
530REPEAT
540A%=GET
550IF A%=138 A%=13:B%=12
560IF A%=139 A%=13:B%=14
570IF A%=136 OR A%=137:N%=A%:A%=13
580IF A%<>127 IF A%<>13 Name$=Name$+CH
R$(A%)
590IF A%<>13 IF LEN (Name$)>0 VDUA%
600IF A%=127 IF LEN(Name$)>0 Name$=LEF
T$(Name$,(LEN(Name$)-1))
610UNTILLEN Name$=18 OR A%=13
620IF A%=13 FOR L%=LEN(Name$) TO 17:Na
me$=Name$+" ":NEXT
630A%=0
640PROCsave
650ENDPROC
660DEFPROCsave
670PTR#F%=PTR#F%-36
680PRINT#F%,Tot1$
690PRINT#F%,Tot2$
700PRINT#F%,Name$
710ENDPROC
720DEFPROCdotot
730VDU31,19,B%
740PRINTSPC(6)
750VDU31,19,B%,A%
760T$=CHR$(A%)
770REPEAT
780REPEAT
790A%=GET
800IF A%=136 OR A%=137:N%=A%:A%=13
810UNTIL A%>44 AND A%<58 OR A%=13 OR A
%=127 OR A%=138 OR A%=139
820IF A%>44 AND A%<58 T$=T$+CHR$(A%)
830IF A%<>13 IF LEN (T$)>0 VDUA%
840IF A%=127 IF LEN(T$)>0 T$=LEFT$(T$,
(LEN(T$)-1))
850UNTILLEN T$=6 OR A%=13 OR A%=138 OR
A%=139
860IF A%=13 OR A%=138 OR A%=139 FOR L%
=LEN(T$) TO 5:T$=T$+" ":NEXT
870IF B%=12 Tot1$=T$
880IF B%=14 Tot2$=T$
890IF A%=138 B%=B%+2:IF B%=16 B%=10
900IF A%=139 B%=B%-2
910A%=0
920PROCsave
930ENDPROC
940DEFPROCprintout
950CLS
960PRINT"To Printer? Y/N"
970REPEAT
980B$=GET$
990UNTILINSTR("YyNn",B$)
1000IF INSTR("Yy",B$):PRINT"Prepare Pri
nter And Press a Key":OSCLI"FX21":REPEAT
UNTILGET:VDU2 ELSE PRINT"Press SHIFT to
Scroll Text":VDU14
1010PTR#F%=0
1020REPEAT
1030PROCread
1040PRINTName$;" ";Tot1$;" ";Tot2$
1050UNTILEOF#F%
1060VDU3,15
1070*FX21
1080PRINT"Press a key"
1090REPEATUNTILGET
1100CLS
1110ENDPROC