--- title: "Budgeter" id: 51708 type: "computer_media" slug: "budgeter-2" url: "http://localhost/computer_media/budgeter-2/" markdown_url: "http://localhost/computer_media/budgeter-2.md" published_at: "2023-08-13T23:14:28+00:00" modified_at: "2026-03-30T21:29:18+00:00" author: "David Anderson" featured_image: url: "http://localhost/wp-content/uploads/2022/03/Budgeter-3.png" excerpt: "A full home budgeting system lets you track monthly budget versus actual spending across up to 50 accounts, complete with bar-chart graphical analysis and tape file save/load." category: - name: "Archived Media" slug: "archived-media" taxonomy: "category" url: "http://localhost/category/archived-media/" post_tag: - name: "Downloadable" slug: "downloadable" taxonomy: "post_tag" url: "http://localhost/tag/downloadable/" - name: "Timex Computer Corporation" slug: "timex-computer-corporation" taxonomy: "post_tag" url: "http://localhost/tag/timex-computer-corporation/" - name: "TS 2068" slug: "ts2068" taxonomy: "post_tag" url: "http://localhost/tag/ts2068/" model: - name: "Timex/Sinclair 2068" slug: "ts-2068" taxonomy: "model" url: "http://localhost/model/ts-2068/" genre: - name: "Home" slug: "home" taxonomy: "genre" url: "http://localhost/type/home/" media_type: "Cartridge" download_url: "https://archive.org/download/timex-sinclair-software-archive/Budgeter (1983)(Timex)(US)(TS2068)(Cartridge).zip" mediadate: "1983" producer_company: - id: 11401 title: "Timex Computer Corporation" type: "company" url: "http://localhost/company/timex-computer-corporation/" related_products: - id: 35331 title: "The Budgeter (cart)" type: "product" url: "http://localhost/product/the-budgeter-cart/" media_type_tags: "Home" --- # Budgeter This program is a menu-driven home accounts management system that tracks budget versus actual spending across 12 months for up to 50 named accounts. Account data is stored in a 50×200 string array A$, with each account’s name occupying the first 8 characters and monthly budget/actual pairs packed as 6-character string fields starting at position 12. The system offers add, delete, adjust, list, total computation, tape load/save, and a bar-chart graphical analysis using PLOT and DRAW commands to render paired blue-budget and red-actual columns for all 12 months. A companion loader program (lines 10–50) loads a screen file and the main program from tape, while the main program can re-save itself using SAVE “home” LINE 5054. Error handling uses ON ERR GO TO 9150 throughout, with a flashing red error banner and ON ERR RESET at program termination. *** ## Program Analysis ### Program Structure The listing contains two distinct programs. The first (lines 10–50) is a bootstrap loader that loads a screen binary at address 16384 (the display file), then chain-loads the main program called `"home"`. The main program begins at line 10 and is organized as a central menu dispatcher at lines 62–130 that calls numbered subroutines for each of 11 functions. | Lines | Function | | --- | --- | | 10–49 | Initialization: error trapping, array allocation, UDG setup | | 50–130 | Splash screen and main menu dispatcher | | 600–699 | Decorative banner subroutine using UDG \a | | 1000–1499 | Add account | | 1500–1999 | Delete account | | 2000–2499 | Adjust account | | 2500–2999 | Print account details | | 3000–3499 | List all accounts | | 3500–3999 | Compute totals | | 4000–4499 | Load data file from tape | | 4500–4999 | Save data file to tape | | 5000–5499 | Save program logic to tape | | 5500–5999 | Graphical analysis | | 6000–6049 | Press-Enter pause utility | | 6500–6599 | Optional COPY to printer | | 6600–6680 | Account totals row (single account) | | 6700–6790 | Account totals row (aggregate) | | 7000–7999 | Month-name array setup and column headers | | 8000–8299 | Account name lookup (sets `q`) | | 9000–9100 | Terminate program | | 9150–9999 | Error handler | ### Data Storage Layout The entire data store is a single string array `A$(50,200)`. Each row holds one account. The first 8 characters store the account name (space-padded). Monthly data starts at position 9; for month `n`, budget occupies positions `n*12` to `n*12+5` and actual occupies `n*12+6` to `n*12+11`, giving 6 characters per value. This allows up to 50 accounts with 12 months of budget/actual pairs, all serialized as fixed-width decimal strings. The array is pre-filled with ASCII zeros at line 27 to avoid VAL errors on uninitialized entries. ### UDG Usage Lines 32–36 define UDG `"a"` by poking 8 bytes from a DATA statement. The binary pattern (`BIN 11111111, 11111111, 11100111, 11000011, 11000011, 11100111, 11111111, 11111111`) creates a filled rectangle with a hollow diamond center. This UDG is used extensively in the `s$` banner string at line 610, which is printed at screen rows 0 and 12 to create decorative borders using INVERSE and FLASH. ### Month-Name Initialization The subroutine at line 7000 uses `RESTORE 7070` and `READ` to populate the `M$(12,3)` array from inline DATA at line 7070. The same RESTORE/READ block is re-entered from line 7020 when called with `xj=22` (the “detail view” path), in which case it returns early at line 7061 after loading names without printing column headers — a dual-purpose routine controlled by the global flag `xj`. ### Control Flags Two global numeric variables act as behavioral flags across subroutines: - `xj` — when set to 22, suppresses the month-name print loop in the subroutine at line 7000 and modifies column header behavior in the detail/totals display paths. - `rr` — when set to 11, causes the account detail subroutine at line 2557 to `RETURN` immediately after printing (line 2569), bypassing the printer prompt and pause, used when called from the delete and adjust screens. - `kk` — when set to 7, causes the totals computation at line 3666 to return before printing, so that the graphical analysis routine at line 5500 can call the totals accumulation loop directly and use the results without screen output. ### Graphical Analysis The bar chart routine (lines 5500–5999) uses PLOT/DRAW to render paired vertical bars for each of 12 months. Blue (INK 1) bars represent budget and red (INK 2) bars represent actual spending. A scaling factor `gg` is computed as `130/top` where `top` is the maximum value across all 24 data points, mapping values to a 130-pixel vertical range. Each bar is 5 pixels wide, with budget bars starting at x=25 and actual bars at x=32 within each 16-pixel-wide month slot. Horizontal grid lines are drawn every 5 pixels from y=30 to y=165 by the subroutine at line 5840. ### Error Handling The program sets `ON ERR GO TO 9150` at multiple points (lines 10, 43, 60, 62, 9168). The error handler at line 9150 prints a flashing INK 2 error banner, beeps, pauses, clears the banner, then re-arms itself with `ON ERR GO TO 9150` followed immediately by `ON ERR CONTINUE`. This sequence attempts to resume execution after a recoverable error while still catching new ones. At program termination (lines 9074 and 9150 entry), `ON ERR RESET` disables error trapping before STOP. ### Notable Techniques and Anomalies - The string padding idiom `N$=N$+" "( TO 8-LEN N$)` at line 1110 appends a slice of a space literal to pad to exactly 8 characters — a common Sinclair BASIC technique exploiting string slicing. - The delete routine at lines 1600–1610 wraps the single assignment in a `FOR n=1 TO 1`/`NEXT n` loop, which has no functional effect but may reflect a refactored remnant. - The printer prompt at line 6500 uses a busy-wait `IF INKEY$="" THEN GO TO 6530` rather than INPUT, accepting a single keypress without requiring Enter. - Line 5052 saves the running program with `SAVE "home" LINE 5054`, and line 5054 is the `GO TO 42` that restarts execution — so the saved program auto-runs directly back into the main loop, preserving any data currently in memory only until the next load overwrites `A$()`. - The `w$` variable is used inconsistently: in some subroutines it holds an account name entered by the user (uppercase search key), while in others it is assigned from `n$` (line 1254). The lookup subroutine at line 8020 pads `w$` to 8 characters before searching, which handles both cases. - Lines 5635 re-dimensions `t(12)` and `c(12)` inside the graphical analysis routine, silently clearing the totals arrays that were just populated at line 5536. This means after a “TOTAL” graph, the aggregate totals are lost; however since `kk` is reset to 0 and the menu re-entered, this has no practical consequence. ## Source Code ``` 10 CLS 20 LOAD "front2s"CODE 16384,6912 30 LOAD "home" 40 STOP 50 SAVE "loader" LINE 10 10 ON ERR GO TO 9150 20 REM CLS : PRINT INK 2;AT 10,4;"Initializing storage," 22 REM PRINT INK 2;AT 11,7;"PLEASE STAND BY" 25 DIM A$(50,200) 27 FOR n=1 TO 50: LET a$(n,9 TO 200)="00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000": NEXT n 31 GO TO 42 32 RESTORE 34: FOR n=0 TO 7: READ r: POKE USR "a"+n,r: NEXT n 34 DATA BIN 11111111,BIN 11111111,BIN 11100111,BIN 11000011,BIN 11000011,BIN 11100111,BIN 11111111,BIN 11111111 36 RETURN 42 BORDER 5: GO SUB 32 43 INK 1: ON ERR GO TO 9150 44 LET xj=0: LET rr=0 45 INVERSE 0 46 DIM M$(12,3) 47 LET MAX=50 48 PAPER 6 49 DIM t(12): DIM c(12) 50 CLS 51 GO SUB 600 52 BRIGHT 1: PRINT AT 9,9;"HOME ACCOUNTS": BRIGHT 0 53 PRINT AT 10,8;"\..\..\..\..\..\..\..\..\..\..\..\..\..\..\.." 54 PRINT AT 20,6;"Copyright TIMEX 1982" 56 PRINT AT 11,6;"TS2000 WITH 48K RAM" 58 FLASH 0: INVERSE 1: PRINT AT 21,0;"PRESS ENTER WHEN READY ": INVERSE 0: FLASH 0 59 INPUT y$ 60 ON ERR GO TO 9150 62 ON ERR GO TO 9150: CLS 63 DIM t(12): DIM c(12): DIM d(12) 64 BRIGHT 1: INK 3: PRINT AT 0,2;"Home Accounts Selection Menu": BRIGHT 0 65 INK 1 66 PRINT AT 2,4;" 1=ADD ACCOUNT" 68 PRINT AT 3,4;" 2=DELETE ACCOUNT" 70 PRINT AT 4,4;" 3=ADJUST ACCOUNT" 72 PRINT AT 5,4;" 4=PRINT ACCOUNT DETAILS" 74 PRINT AT 6,4;" 5=LIST ALL ACCOUNTS" 76 PRINT AT 7,4;" 6=COMPUTE TOTALS" 78 PRINT AT 8,4;" 7=LOAD DATA FILE" 80 PRINT AT 9,4;" 8=SAVE DATA FILE" 82 PRINT AT 10,4;" 9=SAVE PROGRAM LOGIC" 84 PRINT AT 11,4;"10=GRAPHICAL ANALYSIS" 86 PRINT AT 12,4;"11=TERMINATE PROGRAM" 88 INVERSE 1 90 PRINT AT 20,0;"ENTER OPTION NUMBER" 92 INVERSE 0 94 INPUT OP 95 PRINT OP 96 IF OP<1 OR OP>11 THEN GO TO 62 98 LET kk=0 100 IF OP=1 THEN GO SUB 1000 102 IF OP=2 THEN GO SUB 1500 104 IF OP=3 THEN GO SUB 2000 106 IF OP=4 THEN GO SUB 2500 108 IF OP=5 THEN GO SUB 3000 110 IF OP=6 THEN GO SUB 3500 112 IF OP=7 THEN GO SUB 4000 114 IF OP=8 THEN GO SUB 4500 116 IF OP=9 THEN GO SUB 5000 118 IF OP=10 THEN GO SUB 5500 120 IF OP=11 THEN GO SUB 9000 130 GO TO 62 600 REM 610 LET s$=" \a\a \a\a \a\a \a\a \a\a\a\a\a\a \a\a\a\a\a\a \a\a\a\a\a\a \a\a\a\a\a\a \a \a\a \a \a\a \a \a\a \a \a\a \a\a\a\a\a\a \a\a\a\a\a\a \a\a\a\a\a\a \a\a\a\a\a\a \a\a \a \a\a \a \a\a \a \a\a \a \a\a\a\a\a\a \a\a\a\a\a\a \a\a\a\a\a\a \a\a\a\a\a\a \a\a \a\a \a\a \a\a " 620 INVERSE 1: FLASH 1: BRIGHT 0: INK 4: PRINT AT 0,0;s$;AT 12,0;s$: INK 1: BRIGHT 0: FLASH 0: INVERSE 0 699 RETURN 999 STOP 1000 REM 1010 CLS 1020 FOR N=1 TO MAX 1030 IF A$(N,1 TO 8)<>" " THEN GO TO 1100 1040 NEXT N 1050 PRINT "CURRENT FILE IS EMPTY" 1052 PRINT 1054 PRINT "IF YOU ARE GOING TO LOAD A " 1056 PRINT "DATA FILE YOU MUST DO SO NOW" 1058 PRINT 1060 PRINT "IS DATA TO BE LOADED FROM TAPE ?" 1062 PRINT "y/n" 1064 INPUT Y$ 1066 IF y$="y" THEN GO SUB 4000 1068 IF y$="n" THEN GO TO 1100 1070 GO TO 1060 1100 REM 1102 CLS 1104 PRINT "OK" 1106 PRINT "INPUT ACCOUNT (8 CHARS IS MAX)" 1108 INPUT N$: PRINT N$ 1109 IF LEN N$>8 THEN GO TO 1112 1110 LET N$=N$+" "( TO 8-LEN N$) 1111 IF LEN N$<9 THEN GO TO 1113 1112 CLS : PRINT N$;" IS TOO LARGE(8 CHARS)": BEEP 2,0: GO SUB 6000: GO TO 62 1113 FOR N=1 TO MAX 1114 IF A$(N,1 TO 8)=N$ THEN GO TO 1140 1116 NEXT N 1120 GO TO 1150 1140 PRINT "ACCOUNT ";N$;" ALREADY EXISTS" 1142 PRINT "BACK TO MENU" 1144 BEEP 2,0 1145 GO SUB 6000 1146 GO TO 62 1150 REM 1152 FOR q=1 TO MAX 1154 IF A$(q,1 TO 8)=" " THEN GO TO 1170 1156 NEXT q 1158 PRINT "FILE FULL -- BACK TO MENU" 1160 BEEP 2,0 1162 GO SUB 6000 1164 GO TO 62 1170 REM 1174 LET A$(q,1 TO 8)=N$ 1178 REM 1180 CLS 1182 BRIGHT 1: PRINT "Account Add Panel-- ";n$: BRIGHT 0 1184 GO SUB 7000 1186 REM 1200 FOR N=1 TO 12 1202 BRIGHT 1: PRINT AT 2+N,7;"---->": BRIGHT 0 1204 BRIGHT 1: INK 2: PRINT AT 18,0;"INPUT BUDGET FOR MONTH ";M$(N): INK 1: BRIGHT 0 1208 INPUT B 1210 IF LEN STR$ b>6 THEN PRINT AT 19,0;"only 6 characters": BEEP 1,2: PAUSE 50: PRINT AT 19,0;" ": GO TO 1204 1212 PRINT AT 2+N,12;B 1213 LET a$(q,n*12 TO n*12+5)=STR$ b 1214 BRIGHT 1: PRINT AT 2+N,18;"---->": BRIGHT 0 1215 PRINT AT 2+N,7;" " 1216 BRIGHT 1: INK 2: PRINT AT 18,0;"INPUT ACTUAL FOR MONTH ";M$(N): INK 1: BRIGHT 0 1220 INPUT A 1222 IF LEN STR$ a>6 THEN PRINT AT 19,0;"only 6 characters": BEEP 1,2: PAUSE 50: PRINT AT 19,0;" ": GO TO 1216 1224 PRINT AT 2+N,23;A 1225 LET a$(q,n*12+6 TO n*12+11)=STR$ a 1226 PRINT AT 2+N,18;" " 1228 NEXT N 1240 BRIGHT 1: PRINT AT 18,0;"IS ALL THE ABOVE DATA CORRECT? y/n": BRIGHT 0 1242 INPUT Y$ 1244 IF Y$="y" THEN GO TO 1260 1248 IF Y$="n" THEN GO TO 1252 1250 GO TO 1240 1252 CLS 1254 LET w$=n$ 1256 BRIGHT 1: PRINT "Account adjustment screen": BRIGHT 0 1258 GO SUB 2055 1260 CLS 1264 GO TO 62 1499 RETURN 1500 REM 1510 CLS 1520 BRIGHT 1: PRINT "Account Delete screen": BRIGHT 0 1530 PRINT 1540 PRINT "ENTER ACCOUNT TO DELETE " 1550 INPUT w$ 1552 INK 2: PRINT : PRINT "Account--";w$: INK 1 1555 GO SUB 8000 1560 LET xj=22 1562 LET rr=11 1570 GO SUB 2557 1572 LET xj=0 1574 LET rr=0 1578 PRINT "IS THIS THE ACCOUNT TO DELETE ? y/n" 1580 INPUT y$ 1582 IF y$="y" THEN GO TO 1600 1584 IF y$="n" THEN GO TO 62 1586 GO TO 62 1590 REM 1600 FOR n=1 TO 1 1605 LET a$(q,1 TO 8)=" " 1610 NEXT n 1630 PRINT "ACCOUNT DELETED" 1640 GO SUB 6000 1999 RETURN 2000 REM 2010 CLS 2020 BRIGHT 1: PRINT "Account adjustment screen": BRIGHT 0 2030 PRINT 2040 PRINT "ENTER ACCOUNT " 2050 INPUT W$ 2055 INK 2: PRINT AT 2,20;W$: INK 1 2060 GO SUB 8000 2062 LET rr=11 2064 GO SUB 2557 2066 LET rr=0 2070 PRINT 2072 PRINT AT 19,0;"ENTER MONTH TO ADJUST" 2074 INPUT s$ 2076 LET m=0 2078 IF s$="jan" THEN LET m=1 2080 IF s$="feb" THEN LET m=2 2082 IF s$="mar" THEN LET m=3 2084 IF s$="apr" THEN LET m=4 2086 IF s$="may" THEN LET m=5 2088 IF s$="jun" THEN LET m=6 2090 IF s$="jul" THEN LET m=7 2100 IF s$="aug" THEN LET m=8 2110 IF s$="sep" THEN LET m=9 2120 IF s$="oct" THEN LET m=10 2130 IF s$="nov" THEN LET m=11 2140 IF s$="dec" THEN LET m=12 2142 IF m=0 THEN GO TO 2074 2145 INK 3 2147 PRINT AT 3+m,23;" " 2148 BRIGHT 1: PRINT AT 3+m,3;"--->": BRIGHT 0 2150 BRIGHT 1: PRINT AT 19,0;"INPUT BUDGET FOR ";s$: BRIGHT 0 2160 INPUT b 2161 IF LEN STR$ b>6 THEN PRINT AT 20,0;"only 6 characters": BEEP 1,2: PAUSE 50: PRINT AT 20,0;" ": GO TO 2150 2162 PRINT AT 3+m,7;" " 2165 PRINT AT 3+m,7;b 2170 BRIGHT 1: PRINT AT 19,0;"INPUT ACTUAL FOR ";s$: BRIGHT 0 2180 INPUT a 2182 IF LEN STR$ a>6 THEN PRINT AT 20,0;"only 6 characters": BEEP 1,2: PAUSE 50: PRINT AT 20,0;" ": GO TO 2170 2190 LET v=b-a 2195 PRINT AT 3+m,15;" " 2200 PRINT AT 3+m,15;a;AT 3+m,23;v 2210 LET a$(q,m*12 TO m*12+5)=STR$ b 2220 LET a$(q,m*12+6 TO m*12+11)=STR$ a 2230 PRINT AT 19,0;"ANY MORE MONTHS TO CHANGE? y/n" 2240 INPUT y$ 2242 PRINT AT 19,0;" " 2250 IF y$="y" THEN GO TO 2072 2252 IF y$="n" THEN GO TO 2495 2254 GO TO 2230 2495 INK 1 2496 GO SUB 2545 2498 GO SUB 6000 2499 RETURN 2500 REM 2510 CLS 2520 REM 2530 PRINT 2540 PRINT "ENTER ACCOUNT TO BE PRINTED" 2542 INPUT w$ 2545 CLS 2550 BRIGHT 1: PRINT "Account Detail List-- ";w$: BRIGHT 0 2552 GO SUB 8000 2555 PRINT 2557 PRINT "Month Budget Actual Variance" 2558 LET xj=22 2559 GO SUB 7020 2560 FOR n=1 TO 12: INK 1 2561 LET v=VAL a$(q,n*12 TO n*12+5)-VAL a$(q,n*12+6 TO n*12+11): IF v<0 THEN INK 2 2562 PRINT m$(n);" ";a$(q,n*12 TO n*12+5);" ";a$(q,n*12+6 TO n*12+11);" ";v 2564 NEXT n 2565 GO SUB 6600 2568 LET xj=0 2569 IF rr=11 THEN RETURN 2570 GO SUB 6500 2572 GO SUB 6000 2999 RETURN 3000 REM 3010 CLS 3020 BRIGHT 1: PRINT "Accounts on file": BRIGHT 0 3030 PRINT 3040 FOR n=1 TO max STEP 3 3045 IF n>max THEN GO TO 3060 3050 PRINT a$(n,1 TO 8);" "; 3052 IF n+1>max THEN GO TO 3060 3053 PRINT a$(n+1,1 TO 8);" "; 3055 IF n+2>max THEN GO TO 3060 3057 PRINT a$(n+2,1 TO 8);" " 3060 NEXT n 3065 GO SUB 6500 3070 GO SUB 6000 3499 RETURN 3500 REM 3510 DIM t(12) 3520 DIM c(12) 3530 DIM d(12) 3540 CLS 3550 BRIGHT 1: PRINT "Account Total Panel": BRIGHT 0 3555 LET xj=22 3557 PRINT 3558 PRINT "Month Budget Actual Variance" 3560 GO SUB 7020 3651 FOR q=1 TO max: IF a$(q,1 TO 8)=" " THEN GO TO 3664 3652 FOR n=1 TO 12 3654 LET jj=VAL a$(q,n*12 TO n*12+5) 3656 LET t(n)=jj+t(n) 3658 LET c(n)=VAL a$(q,n*12+6 TO n*12+11)+c(n) 3660 LET d(n)=t(n)-c(n) 3662 NEXT n 3664 NEXT q 3665 LET q=1 3666 IF kk=7 THEN RETURN 3668 FOR n=1 TO 12 3669 IF d(n)<0 THEN INK 2 3670 PRINT AT 2+n,0;m$(n);AT 2+n,7;t(n);AT 2+n,15;c(n);AT 2+n,24;d(n) 3671 INK 1 3672 NEXT n 3675 GO SUB 6700 3775 LET xj=0 3778 GO SUB 6500 3780 GO SUB 6000 3999 RETURN 4000 REM 4002 CLS 4003 BRIGHT 1: PRINT "Account data file load screen": BRIGHT 0 4007 PRINT "INPUT FILE NAME" 4009 INPUT x$ 4010 PRINT x$ 4015 PRINT "SET RECORDER UP FOR LOADING": PRINT : PRINT "PRESS PLAY ON RECORDER" 4018 PRINT "PRESS ENTER WHEN READY" 4019 INPUT Y$ 4020 LOAD x$ DATA a$() 4030 CLS : PRINT AT 10,8;"Stop the tape" 4035 BEEP 2,2 4040 GO SUB 6000 4499 GO TO 62 4500 REM 4510 CLS 4511 BRIGHT 1: PRINT "Account data file save screen": BRIGHT 0 4512 PRINT "SET RECORDER FOR SAVE" 4515 PRINT 4520 PRINT "ENTER SAVE NAME" 4530 INPUT y$ 4532 IF LEN y$>10 THEN PRINT "name to big- max is 10 chars": GO TO 4520 4534 IF LEN y$<1 THEN PRINT "name cannot be blank": GO TO 4520 4536 IF y$(1 TO 1)=" " THEN PRINT "name cannot be blank": GO TO 4520 4540 PRINT y$ 4550 PRINT "PRESS ENTER WHEN READY" 4560 INPUT X$ 4570 SAVE y$ DATA a$() 4580 BEEP 2,0 4590 FLASH 1 4591 CLS 4592 PRINT AT 10,10;"STOP THE TAPE" 4593 GO SUB 6000 4594 FLASH 0 4595 GO TO 62 5000 REM 5010 CLS 5020 PRINT INK 2;"Program logic save screen" 5030 PRINT : PRINT "Set recorder up for a save" 5040 GO SUB 6000 5050 REM INPUT Y$ 5052 SAVE "home" LINE 5054 5054 GO TO 42 5061 FLASH 1 5062 CLS 5063 PRINT AT 10,5;"STOP THE TAPE" 5065 GO SUB 6000 5066 FLASH 0 5070 GO TO 42 5499 RETURN 5500 REM 5502 CLS 5504 BRIGHT 1: PRINT "Account graphical analysis": BRIGHT 0 5510 PRINT 5515 PRINT "ENTER ACCOUNT or xxxx FOR TOTAL" 5520 INPUT w$ 5530 PRINT w$ 5535 IF w$="xxxx" THEN LET kk=7 5536 IF w$="xxxx" THEN GO SUB 3651 5537 IF w$="xxxx" THEN GO TO 5545 5540 GO SUB 8000 5545 IF w$="xxxx" THEN LET w$="TOTAL" 5550 CLS 5560 BRIGHT 1: PRINT AT 0,0;w$;" blue=budget red=actual": BRIGHT 0 5570 DIM d(24) 5580 LET x=1 5590 FOR n=1 TO 12 5600 LET d(x)=VAL a$(q,n*12 TO n*12+5) 5602 IF w$="TOTAL" THEN LET d(x)=t(n) 5605 LET d(x+1)=VAL a$(q,n*12+6 TO n*12+11) 5606 IF w$="TOTAL" THEN LET d(x+1)=c(n) 5607 LET x=x+2 5610 NEXT n 5612 LET top=0 5620 FOR n=1 TO 24 5625 IF top"y" THEN GO TO 6500 6555 PRINT AT 21,30;y$ 6560 COPY 6599 RETURN 6600 REM 6610 LET tb=0 6620 LET ta=0 6630 LET tv=0 6635 FOR n=1 TO 12 6640 LET tb=VAL a$(q,n*12 TO n*12+5)+tb 6645 LET ta=VAL a$(q,n*12+6 TO n*12+11)+ta 6650 NEXT n 6660 LET tv=tb-ta 6670 INK 0: PRINT AT 18,0;"TOT";AT 18,7;tb;AT 18,15;ta;AT 18,23;tv 6675 INK 1 6680 RETURN 6700 REM 6710 LET tb=0 6720 LET ta=0 6730 LET tv=0 6740 FOR n=1 TO 12 6750 LET tb=tb+t(n) 6760 LET ta=ta+c(n) 6765 NEXT n 6770 LET tv=tb-ta 6775 INK 0: PRINT AT 18,0;"TOT";AT 18,7;tb;AT 18,15;ta;AT 18,24;tv 6780 INK 1 6790 RETURN 7000 REM 7002 INK 0 7004 PRINT 7010 PRINT "Month Budget Actual" 7015 RESTORE 7070 7020 FOR n=1 TO 12 7030 READ x$ 7040 LET m$(n)=x$ 7050 NEXT n 7060 RESTORE 7070 7061 IF xj=22 THEN RETURN 7070 DATA "JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC" 7080 FOR N=1 TO 12 7090 PRINT M$(N) 7100 NEXT N 7102 INK 1 7999 RETURN 8000 REM 8020 LET w$=w$+" "( TO 8-LEN w$) 8030 FOR q=1 TO max 8040 IF a$(q,1 TO 8)=w$ THEN RETURN 8050 NEXT q 8060 CLS 8062 BRIGHT 1: PRINT "No Account called ";w$: BRIGHT 0 8064 GO SUB 6000 8066 GO TO 62 8299 RETURN 9000 REM 9010 CLS 9020 PRINT "ARE YOU SURE YOU WANT TO QUIT ? y/n" 9030 INPUT Y$ 9040 IF Y$="n" THEN GO TO 9100 9042 IF Y$<>"y" THEN GO TO 9100 9050 PRINT 9060 PRINT "PROGRAM STOPPED" 9070 PRINT "TYPE GOTO 42 TO RESTART" 9072 PRINT "WITH DATA INTACT" 9074 ON ERR RESET 9080 STOP 9100 GO TO 42 9150 ON ERR RESET 9154 PRINT INK 2;AT 21,0;"**************ERROR*************" 9158 BEEP 1,1 9160 PAUSE 100 9166 PRINT INK 1;AT 21,0;" " 9168 ON ERR GO TO 9150 9170 ON ERR CONTINUE 9998 STOP 9999 RETURN ```