1000 ON (RC = 0) GOTO 1010:PB = VAL(SB$): FOR X = 1 TO NR:PB = PB - VAL(N$(X,5)): NEXT X
1010 Y = 0:PB = INT((PB +.0051) *100)/100:PB$ = STR$(PB): FOR M = 1 TO LEN(PB$): IF MID$ (PB$,M,1) = "." THEN Y = M
1020 NEXT : IF Y = 0 THEN PB$ = PB$ +".00": RETURN
1030 IF LEN(PB$) = Y +2 THEN RETURN
1040 PB$ = PB$ +"0": RETURN
1050 ON ( PEEK(222) = 6) GOTO 1160: PRINT D$"CLOSE": HOME : ON ( PEEK(222) <4 AND PEEK(222) >21) GOTO 1190
1060 VTAB 10: POKE 36,15: PRINT "AN ERROR OCCURRED WHILE READING OR SAVING RECORDS": PRINT
1070 POKE 36,14: PRINT "CHECK DISK DRIVE OR INVALID FILE NAME AND TRY AGAIN": PRINT : PRINT "PRESS <RETURN> TO CONTINUE ";: GET Q$: PRINT : ON A$ = "Z" GOTO 1080: GOTO 1190
1080 PRINT D$"PR#3": PRINT : HOME : PRINT "NIBBLE BANKER": PRINT "BY ROBERT R. DEVINE": PRINT "COPYRIGHT 1986 BY MICROSPARC, INC."
1090 FOR X = 1 TO 78: PRINT "=";: NEXT : PRINT : PRINT : PRINT : PRINT : PRINT
1100 PRINT "ENTER 1 OR 2 TO SEE CATALOG OF DISK IN THAT DRIVE": PRINT : PRINT "ENTER NAME OF ACCOUNT TO LOAD OR CREATE: ";
1110 INPUT FILE$:F = VAL(FILE$): IF F = 1 OR F = 2 THEN HOME : PRINT D$"CATALOG,D"F: GOTO 1100
1170 HOME : VTAB 10: POKE 36,25: PRINT "DID NOT FIND "FILE$" ON DISK": PRINT : POKE 36,20: PRINT "DO YOU WANT TO START A NEW FILE (Y/N) ? ";: GET Q$: PRINT Q$: IF Q$ < >"Y" AND Q$ < > CHR$(121) THEN GOTO 1080
1180 NF$ = "N": GOTO 1190
1190 HOME : PRINT "CURRENT FILE IS: "FILE$;: POKE 36,60: PRINT "<ESC> TO QUIT": FOR X = 1 TO 78: PRINT "=";: NEXT : PRINT
1200 VTAB 3: PRINT "THERE ARE "NR" RECORDS ON FILE": PRINT : PRINT "SELECT FROM:": PRINT
1270 IF ASC(Q$) >96 THEN QV = ASC(Q$):QV = QV -32:Q$ = CHR$(QV)
1280 ON (Q$ <"A" OR Q$ >"H" OR LEN(Q$) = 0) GOTO 1250:A = ASC(Q$) -64: PRINT Q$
1290 ON (NR >0) GOTO 1310: IF A = 5 OR A > = 7 THEN 1310
1300 VTAB 22: INVERSE : PRINT " YOU MUST READ OR ENTER RECORDS FIRST ": NORMAL : PRINT "PRESS <RETURN> TO CONTINUE";: GET Q$: PRINT : VTAB 21: CALL -958: GOSUB 990: GOTO 1250
1310 ON A GOTO 1340,1400,1640,1930,2490,2660,2930,3020,3030: GOTO 1250
1320 ONERR GOTO 3060
1330 PRINT D$"OPEN "FILE$: PRINT D$"READ "FILE$: INPUT NR: FOR X = 1 TO NR: FOR Y = 1 TO 6: INPUT N$(X,Y): NEXT Y,X: INPUT SB$: PRINT D$"CLOSE": GOTO 1190
1340 HOME : VTAB 10: POKE 36,32: PRINT "*** WARNING ***": PRINT : POKE 36,20: PRINT "<S>AVE WILL WRITE OVER YOUR OLD RECORDS.": POKE 36,28: PRINT "DO YOU WANT TO DO THIS ?";: GET A$: PRINT A$: IF A$ < >"Y" AND A$ < > CHR$(121) THEN GOTO 1190
1350 IF NF$ = "N" THEN 1380
1360 PQ = 1: PRINT D$"OPEN "FILE$: PRINT D$"READ "FILE$: INPUT Y: PRINT D$"CLOSE": HOME : VTAB 10: IF Y < = NR THEN 1380
1370 POKE 36,24: PRINT "YOU ARE ABOUT TO LOSE "Y -NR" RECORDS": PRINT : POKE 36,20: PRINT "DO YOU STILL WANT TO SAVE YOUR RECORDS ?";: GET Q$: IF Q$ < >"Y" AND Q$ < > CHR$(121) THEN PQ = 0: GOTO 1190
1380 HOME : VTAB 10: POKE 36,29:PQ = 1: PRINT "SAVING RECORDS TO DISK": PRINT D$"OPEN "FILE$: PRINT D$"WRITE "FILE$
1390 PRINT NR: FOR X = 1 TO NR: FOR Y = 1 TO 6: PRINT N$(X,Y): NEXT Y,X: PRINT SB$: PRINT D$"CLOSE":PQ = 0: GOTO 1190
1400 HOME : PRINT "SORT RECORDS MENU";: POKE 36,60: PRINT "<ESC> FOR MAIN MENU": FOR X = 1 TO 78: PRINT "=";: NEXT : PRINT
1440 IF ASC(Q$) >96 THEN QV = ASC(Q$):QV = QV -32:Q$ = CHR$(QV)
1450 IF Q$ <"A" OR Q$ >"G" THEN PRINT : GOTO 1430
1460 S = ASC(Q$) -64: ON (S = 8) GOTO 1190: PRINT F$(S)
1470 PRINT : PRINT "***** SORTING *****": PRINT
1480 C = NR
1490 IF S = 2 THEN FOR X = 1 TO NR:N$(X,2) = RIGHT$(N$(X,2),2) + LEFT$(N$(X,2),6): VTAB 20: POKE 36,8: PRINT " * ": NEXT
1500 C = INT(C/3) +1: FOR A = 1 TO NR -C: VTAB 20: POKE 36,8: PRINT "* *"
1510 IF (S = 1 OR S = 5) THEN ON ( VAL(N$(A,S)) < = VAL(N$(A +C,S))) GOTO 1600: GOTO 1540
1520 IF S <7 THEN ON (N$(A,S) < = N$(A +C,S)) GOTO 1600: GOTO 1540
1530 IF N$(A,6) +N$(A,3) +N$(A,4) < = N$(A +C,6) +N$(A +C,3) +N$(A +C,4) THEN 1600
1540 FOR J = 1 TO 6:T$(J) = N$(A +C,J): NEXT J:B = A
1550 FOR J = 1 TO 6:N$(B +C,J) = N$(B,J): NEXT J:B = B -C: IF B < = 0 THEN 1590
1560 IF (S = 1 OR S = 5) THEN ON ( VAL(T$(S)) < VAL(N$(B,S))) GOTO 1550: GOTO 1590
1570 IF S <7 THEN ON (T$(S) <N$(B,S)) GOTO 1550: GOTO 1590
1580 IF T$(6) +T$(3) +T$(4) <N$(B,6) +N$(B,3) +N$(B,4) THEN 1550
1590 FOR J = 1 TO 6:N$(B +C,J) = T$(J): NEXT J
1600 VTAB 20: POKE 36,8: PRINT " * ": NEXT A: IF C >1 THEN 1500
1610 PRINT : IF Q$ = "Y" OR Q$ = CHR$(121) THEN GOTO 1670
1620 IF S = 2 THEN FOR X = 1 TO NR:N$(X,2) = RIGHT$(N$(X,2),6) + LEFT$(N$(X,2),2): VTAB 20: POKE 36,8: PRINT " * ": NEXT
1630 GOTO 1190
1640 HOME : VTAB 10: POKE 36,17: PRINT "DO YOU WANT *** MASTER SORT *** FIRST (Y/N) ?";: GET Q$: IF Q$ < >"Y" AND Q$ < >"N" AND Q$ < > CHR$(121) AND Q$ < > CHR$(110) THEN GOTO 1640
1650 IF Q$ = "N" OR Q$ = CHR$(110) THEN GOTO 1670
1660 S = 7: HOME : VTAB 10: GOTO 1470
1670 HOME : PRINT :TD = 0:TE = 0: VTAB 10: POKE 36,29: PRINT "<Q> QUIT PRINTING": PRINT : POKE 36,18: PRINT "<SPACE> PAUSE - ANOTHER KEY TO CONTINUE": PRINT : POKE 36,11: PRINT "<I>MAGEWRITER, <E>PSON, <S>CREEN OR <R>ETURN - MAIN MENU";: GET Q$: PRINT Q$
1680 IF ASC(Q$) >96 THEN QV = ASC(Q$):QV = QV -32:Q$ = CHR$(QV)
1690 ON (Q$ < >"I" AND Q$ < >"E" AND Q$ < >"S" AND Q$ < >"R") GOTO 1670: ON Q$ = "R" GOTO 1190: IF Q$ < >"S" THEN HOME : POKE 35,0: PRINT CHR$(12); CHR$(21): GOTO 1710
1730 IF Q$ = "I" THEN PRINT CHR$(27)"N"FILE$" EXPENSE REPORT": PRINT : GOTO 1750: REM FOR IMAGEWRITER
1740 PRINT CHR$(14)FILE$" EXPENSE REPORT" CHR$(20): PRINT : REM FOR EPSON
1750 PRINT "REC CHECK# MO/DA PAID TO ... DESCRIPTION AMOUNT CODE": FOR Y = 1 TO 79: PRINT "=";: NEXT : PRINT : IF Q$ = "S" THEN POKE 34,3: REM 3/3/5/9/9/2 SPACES
2120 IF M$ < >"Y" AND M$ < > CHR$(121) THEN GOTO 1930
2130 HOME : VTAB 10: POKE 36,26: PRINT "PRESS <Q> TO QUIT PRINTING": PRINT : POKE 36,15: PRINT "PRESS <SPACE> TO PAUSE - ANY OTHER KEY TO CONTINUE"
2140 PRINT : POKE 36,17: PRINT "<S>CREEN, <P>RINTER OR <R>ETURN TO MAIN MENU ? ";: GET Q$: PRINT : IF Q$ < >"S" AND Q$ < >"P" AND Q$ < >"R" THEN GOTO 2130
2150 IF ASC(Q$) >96 THEN QV = ASC(Q$):QV = QV -32:Q$ = CHR$(QV)
2160 IF Q$ = "P" THEN PRINT D$"PR#1": PRINT CHR$(9)"80N": GOSUB 2180: GOTO 2280
2170 ON (Q$ = "R") GOTO 1190: ON (Q$ < >"S") GOTO 2140: GOSUB 2180: GOTO 2280
2180 HOME : PRINT "SELECTION: "F$(A);
2190 IF (A = B) AND (A$ = "N" OR A$ = CHR$(110)) THEN 2230
2200 IF A1$ = "ALL" GOTO 2230
2210 IF A = B THEN PRINT ">= "A1$;: IF (A$ < >"Y" AND A$ < > CHR$(121)) GOTO 2260
2220 IF A = B THEN GOTO 2240
2230 PRINT "= "A1$;: ON (A$ = "Y" OR A$ = CHR$(121)) GOTO 2240: PRINT : GOTO 2260
2240 PRINT " AND ";: PRINT F$(B);: IF A = B THEN PRINT "<= "B1$: GOTO 2260
2400 IF Q$ = "P" THEN PRINT D$"PR#0": PRINT D$"PR#3": HOME : PRINT : VTAB 20
2410 RC = 1: VTAB 22: POKE 36,27: PRINT "WANT TO SEE MORE RECORDS ?";: GET A$: PRINT A$: ON (A$ < >"Y" AND A$ < >"N" AND A$ < > CHR$(121) AND A$ < > CHR$(110)) GOTO 2410: POKE 34,0: HOME : ON ((A$ = "N" OR A$ = CHR$(110))) GOTO 1190: GOTO 1930
2440 IF N$(X,1) = "DEPST" OR N$(X,1) = "depst" THEN PB$ = " " + RIGHT$(PB$,( LEN(PB$) -1)) +"+"
2450 PRINT PB$;: POKE 36,73: PRINT N$(X,6)
2460 IF (X/55 = INT(X/55)) AND (Q$ < >"S") THEN PRINT CHR$(12): GOSUB 2180
2470 GOTO 2370
2480 HOME : VTAB 10: PRINT "<S>CREEN OR <P>RINTER ?";: GET Q$: PRINT : IF Q$ = "P" THEN PRINT D$"PR#1": PRINT CHR$(9)"80N": PRINT CHR$(27)"N" CHR$(0): GOTO 2180
2490 HN = 0: FOR X = 1 TO NR +1: IF VAL(N$(X,1)) >HN THEN HN = VAL(N$(X,1))
2500 NEXT
2510 HOME :I$ = "": PRINT "CURRENT FILE IS: "FILE$;: POKE 36,60: PRINT "<ESC> FOR MAIN MENU": FOR X = 1 TO 78: PRINT "=";: NEXT : PRINT
2520 VTAB 3: PRINT "THE LAST CHECK ON FILE IS "HN: VTAB 4: PRINT "YOU ARE ENTERING RECORD # "NR +1
2530 RR$(1) = "": FOR MM = 3 TO 6:RR$(MM) = "": NEXT
2540 IF NR > = 225 THEN VTAB 20: PRINT "YOU ARE LIMITED TO 225 RECORDS": PRINT "SAVE THIS FILE AND BEGIN A NEW ONE": PRINT : PRINT "PRESS <RETURN> TO CONTINUE";: GET Q$: PRINT Q$: GOTO 1190
2550 GOSUB 1000
2560 VTAB 7: PRINT "ENTER 'DEPST' AS CHECK # WHEN ENTERING DEPOSITS": IF NR = 0 THEN 2580
2570 VTAB 5: PRINT "RECORD "NR" IS CHECK # ";N$(NR,1)
2580 POKE 34,9: RESTORE :MM = 0: GOSUB 150: TEXT
2590 FOR R = 1 TO 6:N$(NR +1,R) = RR$(R): NEXT :RR$(1) = "": FOR R = 3 TO 6:RR$(R) = "": NEXT
2600 IF N$(NR +1,1) = "DEPST" OR N$(NR +1,1) = "depst" THEN N$(NR +1,5) = "-" +N$(NR +1,5): REM IT'S A DEPOSIT
2700 IF ASC(A$) >96 THEN QV = ASC(A$):QV = QV -32:A$ = CHR$(QV)
2710 ON (A$ <"A" OR A$ >"B") GOTO 2690: PRINT A$
2720 A = ASC(A$) -64: PRINT : ON A GOTO 2770,2730: GOTO 2690
2730 INPUT "DELETE WHAT RECORD # ";B$:B = VAL(B$)
2740 IF B >NR THEN PRINT : POKE 36,23: PRINT "THERE ARE ONLY "NR" RECORDS ON FILE": PRINT : PRINT "PRESS <RETURN> TO CONTINUE ";: GET Q$: PRINT : GOTO 2660
2750 GOSUB 2800: PRINT "DELETE THIS RECORD (Y/N) ?";: GET Q$: PRINT Q$: IF Q$ < >"Y" AND Q$ < > CHR$(121) THEN 2660
2760 FOR X = B TO NR -1: FOR Y = 1 TO 6:N$(X,Y) = N$(X +1,Y): NEXT Y,X:NR = NR -1: HOME : VTAB 12: PRINT "RECORD # "B" DELETED": PRINT : FOR X = 1 TO 2500: NEXT : GOTO 2660
2770 INPUT "CHANGE WHAT RECORD # ? ";B$:B = VAL(B$): ON (B >NR) GOTO 2740: IF B$ = CHR$(27) THEN 1190
2780 GOSUB 2800: POKE 36,1: VTAB 23: PRINT "CHANGE THIS ONE?";: GET CH$: IF CH$ < >"Y" AND CH$ < > CHR$(121) THEN 2660
2790 PRINT : GOTO 2840
2800 PRINT : FOR A = 1 TO 6: PRINT F$(A);: POKE 36,29
2810 IF A = 5 AND VAL(N$(B,A)) <0 THEN QB$ = N$(B,A):QB$ = RIGHT$(QB$, LEN(QB$) -1): PRINT QB$" ";: GOTO 2830
2820 PRINT N$(B,A)" ";
2830 FOR I = 1 TO 19 - LEN(N$(B,A)): PRINT " ";: NEXT I: PRINT : NEXT A: PRINT : RETURN
2840 VTAB 15: PRINT : PRINT " ": POKE 36,1: VTAB 16: FOR A = 1 TO 6:R = A +15:I$ = ""
2850 IF A = 5 AND VAL(N$(B,A)) <0 THEN HH = 29:L = L(A):QQ$ = FA$(A):QB$ = N$(B,A):QB$ = RIGHT$(QB$, LEN(QB$) -1): GOTO 2870
2860 HH = 29:L = L(A):QQ$ = F$(A):QB$ = N$(B,A)
2870 MM = 0:MAX = 19:GP$ = LEFT$(QB$,1): GOSUB 870
2880 IF A = 5 AND VAL(N$(B,A)) <0 THEN QB$ = "-" +QB$
2890 N$(B,A) = QB$: IF A = 5 THEN RC = 1
2900 IF MM = 7 THEN 1190
2910 NEXT A: PRINT : POKE 36,1: VTAB 23: CALL -868: PRINT "OK? (Y/N) ";: GET CH$: IF CH$ < >"Y" AND CH$ < > CHR$(121) THEN PRINT : GOTO 2840
2920 GOTO 2660
2930 HOME : PRINT "SET STARTING BALANCE";: POKE 36,60: PRINT "<ESC> FOR MAIN MENU": FOR X = 1 TO 78: PRINT "=";: NEXT : PRINT
2940 VTAB 23: PRINT "<RETURN> TO ACCEPT": POKE 35,19
2960 IF VAL(QB$) >999999 OR VAL(QB$) < -999999 THEN PRINT CHR$(7);: GOTO 2950: REM 6 9'S
2970 IF LEN(QB$) <1 THEN QB$ = "0": GOTO 3000
2980 ZZ = 0: FOR X = LEN(QB$) TO 1 STEP -1: IF MID$ (QB$,X,1) = "." THEN ZZ = LEN(QB$) -X
2990 NEXT : IF ZZ < >0 AND ZZ < >2 THEN PRINT CHR$(7);: GOTO 2950
3000 SB$ = QB$: TEXT
3010 RC = 1: GOTO 1190
3020 HOME : VTAB 10: POKE 36,11: PRINT "HAVE YOU SAVED YOUR WORK ON THE "FILE$" CHECKING FILE ?";: GET Q$: PRINT Q$: ON ((Q$ < >"Y" AND Q$ < > CHR$(121))) GOTO 1190: CLEAR : GOTO 850
3030 HOME : VTAB 10: POKE 36,11: PRINT "HAVE YOU REMEMBERED TO SAVE ALL OF YOUR WORK TO THE DISK?";: GET A$: IF A$ < >"Y" AND A$ < > CHR$(121) THEN 1190
3040 TEXT : HOME : END
3050 REM ***** STANDARD ERROR HANDLING ROUTINE ****
3060 ER = PEEK(222):EL = PEEK(219) *256 + PEEK(218)
3070 IF PQ = 1 THEN CALL -3288: PRINT CHR$(7);: GOTO 1340
3080 IF ER = 3 THEN PRINT "NO DEVICE CONNECTED": GOTO 3140
3090 IF ER = 6 THEN PRINT "FILE NOT FOUND": GOTO 3140
3100 IF ER = 8 THEN PRINT "I/O ERROR": GOTO 3140
3110 IF ER = 16 THEN PRINT "SYNTAX ERROR IN LINE "EL: GOTO 3140
3120 IF ER = 255 THEN RESUME
3130 PRINT "UNANTICIPATED ERROR# "ER" IN LINE "EL
3140 POKE 216,0: PRINT
3150 PRINT CHR$(4)"CLOSE": VTAB 23: PRINT "PRESS <RETURN> TO RESTART";: GET CH$: CALL -3288: RESTORE : CLEAR : TEXT : HOME : GOTO 850