Budgeter

Products: The Budgeter
Date: 1983
Type: Program
Platform(s): TS 2068
Tags: Home

This program is a home accounts management system that allows users to track budget versus actual spending across 12 months for up to 50 named accounts, each stored as a fixed-length 200-character string in the array A$(50,200). Numeric data for each month is packed as 6-character substrings within the string array, with budget stored at offsets n*12 to n*12+5 and actual spending at n*12+6 to n*12+11, using VAL to retrieve numeric values. The program provides a 11-option menu covering account add, delete, adjust, detail printing, totals computation, tape load/save, program save, and a graphical bar chart analysis that renders blue budget bars and red actual bars using PLOT and DRAW commands. A custom UDG character “a” is defined at startup using BIN literals to create a filled circle graphic used in the title screen banner. The loader segment (lines 10–50) loads a title screen binary directly into the display file at address 16384 before chaining to the main program.


Program Analysis

Program Structure

The listing contains two distinct segments. Lines 10–50 form a short loader that loads a binary title screen into the display file at address 16384 (6912 bytes), then chains to the main program "home" via LOAD, with line 50 providing a self-save routine. The main program begins at line 10 again (a separate program), with initialization at lines 10–49 and the main menu loop at lines 62–130. Subroutines are organized in blocks:

  • Lines 600–699: Title banner display using UDG characters
  • Lines 1000–1499: Add account
  • Lines 1500–1999: Delete account
  • Lines 2000–2499: Adjust account
  • Lines 2500–2999: Print account details
  • Lines 3000–3499: List all accounts
  • Lines 3500–3999: Compute totals
  • Lines 4000–4499: Load data file from tape
  • Lines 4500–4999: Save data file to tape
  • Lines 5000–5499: Save program logic to tape
  • Lines 5500–5999: Graphical bar chart analysis
  • Lines 6000–6049: “Press Enter” pause routine
  • Lines 6500–6599: Optional printer copy routine
  • Lines 6600–6680: Single-account totals footer
  • Lines 6700–6790: All-accounts totals footer
  • Lines 7000–7999: Month name initialization and header
  • Lines 8000–8299: Account name lookup subroutine
  • Lines 9000–9100: Terminate program
  • Lines 9150–9999: Error handler

Data Storage Scheme

All account data is held in the string array A$(50,200). Each row stores one account: characters 1–8 hold the account name (space-padded), and characters 9–200 hold 12 pairs of 6-character numeric fields. For month n, the budget is at positions n*12 to n*12+5 and the actual figure at n*12+6 to n*12+11. Values are stored as strings using STR$ b and retrieved with VAL a$(q,n*12 TO n*12+5). This packing avoids the need for separate numeric arrays, allowing the whole dataset to be saved and loaded with a single SAVE y$ DATA a$() / LOAD x$ DATA a$() pair.

At initialization (line 27), all 50 rows are pre-filled with 192 zeros from position 9 onward, ensuring VAL never encounters an empty string and generates an error.

UDG and Graphics

Line 32 defines UDG \a (character 144) as a filled circle/ring pattern using eight BIN literals from the DATA statement at line 34. This UDG is then used in s$ at line 610 to draw a decorative border of circular shapes at the top and bottom of the screen via PRINT AT 0,0;s$;AT 12,0;s$ with INVERSE, FLASH, and INK attributes applied.

The graphical analysis in the 5500 block uses PLOT and DRAW to render vertical bar charts. Budget bars are drawn in the default ink (blue-ish), and actual-spending bars use INK 2 (red). A scale factor gg=130/top normalizes bar heights to fit a 130-pixel-tall axis, and horizontal grid lines are drawn every 5 pixels by the subroutine at lines 5840–5885.

Error Handling

ON ERR is used extensively throughout the program. Lines 10, 43, 60, and 62 redirect errors to line 9150, the error handler, which flashes a red error message, beeps, pauses 100 frames, clears the message, then uses ON ERR CONTINUE to attempt resumption. Line 9074 and 9150 use ON ERR RESET before halting or entering the handler, preventing recursive error loops.

Account Lookup and Validation

The subroutine at line 8000 pads the input w$ to exactly 8 characters using the idiom w$=w$+" "( TO 8-LEN w$), then scans A$() for a matching name, returning with q set to the found row index. If no match is found, the routine branches to the main menu. The same padding idiom appears at line 1110 for new account names. Input length is validated by checking LEN STR$ b > 6 for numeric fields, ensuring values fit within the 6-character storage slots.

Notable Techniques and Idioms

  • The xj flag variable is used to short-circuit the month-header subroutine (line 7061: IF xj=22 THEN RETURN), skipping the month-name print when only the array needs populating.
  • The rr flag at line 2569 allows the print-details subroutine (2500 block) to be called from the delete and adjust screens without triggering the post-display options.
  • The kk=7 flag at line 5535 causes the totals computation subroutine (line 3651) to return early via line 3666 without printing, allowing the graphical analysis to reuse the totals loop.
  • The printer copy subroutine at 6500 uses a polling loop (IF INKEY$="" THEN GO TO 6530) to wait for a single keypress, avoiding an INPUT prompt.
  • Line 1600 uses a FOR/NEXT loop from 1 to 1 as a structural placeholder to delete an account, executing only LET a$(q,1 TO 8)=" ".
  • Line 5052 saves the running program with SAVE "home" LINE 5054 so that reloading restarts at line 5054 (GO TO 42), bypassing reinitialization.

Bugs and Anomalies

  • Line 1110 pads N$ using N$=N$+" "( TO 8-LEN N$), but the appended string literal contains 11 spaces. If LEN N$ is 0, this tries to take a slice of length 8 from an 11-character string, which is fine, but if LEN N$ is already 8, the slice ( TO 0) results in an empty string and no padding is added — which is actually the correct behavior, but the guard at line 1109 redirects when LEN N$ > 8, so an exactly 8-character name is still handled correctly.
  • The RESTORE 7070 at line 7060 is issued, but the DATA statement is at line 7070 and the FOR loop that reads from it (lines 7020–7050) begins before 7060 is reached in normal flow through GO SUB 7020 entry — the RESTORE at 7015 correctly resets the pointer before the loop, making the one at 7060 redundant.
  • Lines 5061–5070 (FLASH animation after tape save) are unreachable because execution falls into the SAVE "home" LINE 5054 at line 5052 and never returns past it in normal operation.
  • The delete account routine (lines 1600–1610) always uses the q index found by the lookup subroutine, but the FOR/NEXT 1 TO 1 construct at line 1600 adds no functional value beyond the single POKE-equivalent LET statement inside it.

Content

Appears On

Related Products

Tracks actual vs. budgeted expenditures and computes the difference. Up to 50 categories of expenses can be recorded for a...

Related Articles

Related Content

Image Gallery

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<d(n) THEN LET top=d(n)
 5630 NEXT n
 5635 DIM t(12): DIM c(12)
 5636 LET gg=0
 5638 IF top=0 THEN GO TO 5641
 5640 LET gg=130/top
 5645 DIM k(24)
 5650 FOR n=1 TO 24 STEP 2
 5660 LET k(n)=d(n)*gg
 5670 NEXT n
 5700 PLOT 20,30
 5710 DRAW 0,135
 5720 PLOT 20,30
 5730 DRAW 200,0
 5735 PLOT 20,31
 5740 DRAW 200,0
 5745 PLOT 220,31
 5746 DRAW 0,135
 5747 LET l=0
 5748 GO SUB 5840
 5749 PRINT AT 19,2;" J F M A M J J A S O N D"
 5750 FOR n=1 TO 24 STEP 2
 5755 FOR j=1 TO 5
 5760 PLOT 25+j+l,30
 5762 DRAW 0,k(n)
 5765 NEXT j
 5768 LET l=l+16
 5770 NEXT n
 5772 REM LET gg=16/top
 5775 LET l=0
 5780 FOR n=2 TO 24 STEP 2
 5782 LET k(n)=d(n)*gg
 5785 FOR j=1 TO 5
 5790 INK 2: PLOT 32+j+l,30
 5792 DRAW 0,k(n)
 5795 NEXT j
 5797 LET l=l+16
 5800 NEXT n
 5810 INK 1
 5820 PRINT AT 2,0;top
 5830 PRINT AT 10,0;INT (top/2)
 5832 REM PRINT AT 17,0;0
 5836 GO TO 5996
 5840 FOR n=30 TO 165 STEP 5
 5860 PLOT 20,n
 5870 DRAW 200,0
 5880 NEXT n
 5885 RETURN 
 5996 GO SUB 6500
 5998 GO SUB 6000
 5999 RETURN 
 6000 INVERSE 1
 6010 INK 1
 6020 PRINT AT 21,0;"PRESS ENTER WHEN READY          "
 6030 INPUT Y$
 6040 CLS 
 6042 INVERSE 0
 6049 RETURN 
 6500 INVERSE 1
 6510 INK 1
 6520 PRINT AT 21,0;"COPY TO PRINTER ?    y/n"
 6530 IF INKEY$="" THEN GO TO 6530
 6535 LET y$=INKEY$
 6540 IF y$="n" THEN RETURN 
 6550 IF y$<>"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 

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.

People

No people associated with this content.

Scroll to Top