Insurance Property Record

Date: 1982
Type: Program
Platform(s): TS 2068
Tags: Home

This program is a home insurance property inventory system that allows users to catalog up to 100 household items with descriptions, purchase costs, dates, store codes, and location codes. It also stores general insurance policy information such as policy number, insurer name, agent details, and expiration dates. The search subsystem supports filtering items by price range, purchase date range, store code, location code, or a substring match within item descriptions. Data is persisted by saving the entire program back to tape via SAVE with a LINE parameter, so the initialized arrays are preserved as part of the program. Variables such as W (=1), Z (=0), T (=21), and Y (=150) are set once in the initialization subroutine at line 6000 and reused throughout to save memory.


Program Analysis

Program Structure

The program is organized into well-defined functional blocks accessed via menu-driven GO TO branching. The initialization subroutine at line 60007000 is called first via GO SUB 6000 at line 2. From the main menu at line 101, five options branch to the following sections:

  1. Lines 43004510: View/modify general insurance policy information
  2. Lines 322595: Enter new items sequentially
  3. Lines 9002320: View/modify existing items with search and filter
  4. Lines 27002980: View/modify store code lookup table
  5. Lines 30004080: End run / save data to tape

A secondary listing-type menu appears at lines 902975, offering seven sort/filter modes. The actual filtering logic is consolidated in a shared loop at lines 23962442, dispatched to by GO TO 2385 from multiple entry points.

Initialization and Variable Conventions

The subroutine at line 6000 establishes all constants and data structures. A notable convention throughout the entire program is the use of single-letter variables as named constants:

VariableValuePurpose
W1Used in place of the literal 1 throughout
Z0Used in place of the literal 0 throughout
T21Bottom status/prompt row for PRINT AT
Y150PAUSE duration used for brief pauses
E$32 spacesBlank line used to erase the prompt row

This convention saves memory because single-letter variable references are shorter tokens than two-digit or three-digit numeric literals in the tokenized program.

Data Storage

Up to 100 items are stored across four string arrays and one numeric array, all dimensioned at line 60126017:

  • I$(100,27) — item description (27 characters)
  • C(100) — cost as a floating-point number
  • D$(100,5) — purchase date in MM/YY format (5 characters)
  • S$(100,7) — store code (7 characters)
  • L$(100,6) — location code (6 characters)

An additional pair of arrays, U$(18,7) and V$(18,19), holds a lookup table of up to 18 store codes paired with full store names. Policy-level information is stored in scalar string variables: Z$, Y$, M$, P$, N$, and R$.

The item number displayed to the user is offset by P (entered at line 36 and decremented by 1 at line 38), allowing the user to number items starting from any value rather than always beginning at 1. This offset is consistently applied when printing and validating item numbers.

Search and Filter System

The search subsystem uses a temporary index array T(100) to hold matching item indices. A unified filter loop at lines 23962442 handles all six search types using the current value of A to dispatch to the appropriate comparison:

  • By price range: compares C(I) against upper (U) and lower (LL) bounds
  • By date range: compares substrings of D$(I) against dates stored in G$ and B$
  • By store code: prefix-matches S$(I) using the length LS of the query string A$
  • By location code: prefix-matches L$(I) similarly
  • By item name: sliding-window substring search within I$(I) at lines 24202425

A cross-search feature at lines 20012010 allows a second filter to be applied to results already in T() by checking S=W and branching to line 5000 (not present in this listing — a potential missing section). The variable S tracks whether the current result set is from a prior search.

Display and Pagination

Item listings are paginated five records at a time. The variable F tracks the current page offset into T(), while K tracks the remaining count. Each record occupies three display rows: item number and description on one line, cost and dates on the next. The column layout is fixed:

ColumnField
4–Item number (right-justified)
5Item description
5–11Cost (right-justified with $ prefix)
12Purchase date
18Store code
26Location code

The prompt row at line 21 (T) is cleared before each new prompt by printing E$ (32 spaces) using PRINT AT T,Z;E$.

Tape Save Mechanism

At line 3070, the program saves itself with SAVE "INS" LINE 3. Using LINE 3 means the program will auto-run from line 3 on reload, skipping the GO SUB 6000 initialization at line 2 — this means re-loaded data would bypass re-initialization, preserving array contents loaded from tape. The save sequence includes on-screen tape preparation instructions (lines 30053040) before waiting for the user to press S.

Bugs and Anomalies

  • Line 900 in the main menu dispatch (IF A=3 THEN GO TO 900) targets line 900, but the listing jumps directly to line 902; line 900 is absent from the listing, making this a missing line. The program would report an error if option 3 is selected from the main menu.
  • Line 2385 is referenced by multiple GO TO 2385 statements (lines 2550, 2590, 2620, 2670) but is not present in the listing; the nearest present line is 2395. This would cause errors for search modes 3–6.
  • Line 2466 is the target of GO TO 2466 at line 2454, but the listing shows line 2468 as the next line after 2457; line 2466 is missing, which would cause an error when choosing to list search results.
  • Line 2108 is referenced at lines 2290 and 2300 but is absent; the nearby present line is 2109. Continuing to the next page of results would fail.
  • Line 2080 is the target of IF A=W THEN GO TO 2080 at line 2020, but it does not exist in the listing; the next present line is 2090. Selecting item-number search would fail.
  • Line 5000, the cross-search entry point branched to at line 2006, is absent from the listing entirely.
  • The store code view is entered via GO TO 2700 at line 240, but line 2700 is absent; the nearest present line is 2731. Option 4 from the main menu would fail.
  • Lines 2920 and 2700 are referenced but absent, suggesting portions of the listing may have been omitted or lost.
  • At line 2240, J is set to 6.333333 as a workaround to position the edit cursor on a fixed row (row 18) when editing an item selected by number, since the display formula J*3-W is used elsewhere. This is an intentional but fragile hack.

Content

Appears On

Related Products

Organize and catalog your possessions. Information stored includes item description, serial number, cost, purchase date, store where purchased, and location...

Related Articles

Related Content

Image Gallery

Insurance Property Record

Source Code

    1 REM "INS3"
    2 GO SUB 6000
    3 CLS 
   10 PRINT AT 7,W;"THE INSURANCE PROPERTY RECORD"
   12 PRINT AT 9,4;"(C)1982 TIMEWORKS INC."
   30 PAUSE Y
   32 IF B1>W THEN GO TO 45
   34 PRINT AT T,Z;"INPUT FIRST ITEM NUMBER?"
   36 INPUT P
   38 LET P=P-W
  101 CLS 
  103 LET MP=Z
  104 LET CP=Z
  105 PRINT AT Z,Z;"***INSURANCE PROPERTY RECORD***"
  107 PRINT 
  110 PRINT AT 2,Z;"WHAT WOULD YOU LIKE TO DO ?"
  115 PRINT AT 6,Z;"1. VIEW/MODIFY INFORMATION"
  117 PRINT 
  120 PRINT "2. ENTER NEW ITEMS"
  125 PRINT 
  130 PRINT "3. VIEW/MODIFY ITEMS"
  135 PRINT 
  140 PRINT "4. VIEW/MODIFY STORE CODES"
  145 PRINT 
  160 PRINT "5. END RUN (STORE NEW DATA)"
  170 INPUT A
  210 IF A=W THEN GO TO 4300
  220 IF A=2 THEN GO TO 322
  230 IF A=3 THEN GO TO 900
  240 IF A=4 THEN GO TO 2700
  250 IF A=5 THEN GO TO 3000
  300 GO TO 100
  310 PRINT AT Z,Z;" NO   COST  PDATE  STORE   LOC"
  320 PRINT AT W,Z;"---- ------ ----- ------- ------"
  321 RETURN 
  322 CLS 
  324 GO SUB 310
  325 LET J=Z
  326 LET B=B1
  328 IF B1>100 THEN GO TO 4200
  330 FOR I=B TO 100
  331 LET B1=I
  332 IF I>100 THEN GO TO 4200
  335 LET CP=Z
  337 LET J=J+W
  341 IF J<7 THEN GO TO 351
  343 PRINT AT T,Z;E$
  344 PRINT 
  345 PRINT 
  346 PRINT 
  347 PRINT AT Z,Z;E$
  348 PRINT AT W,Z;E$
  349 GO SUB 310
  350 LET J=6
  354 PRINT AT J*3-W,4-LEN STR$ (I+P);I+P
  355 PRINT AT T,Z;"INPUT ITEM DESCRIPTION?"
  357 INPUT I$(I)
  359 IF I$(I,1 TO 10)="          " THEN GO TO 100
  360 PRINT AT T,Z;E$
  362 PRINT AT J*3-W,5;I$(I)
  364 PRINT AT T,Z;"ENTER COST?"
  365 INPUT A$
  367 IF A$="" THEN GO TO 400
  370 LET C(I)=VAL A$
  380 PRINT AT T,Z;E$
  390 PRINT AT J*3,5;"      ";AT J*3,5;"$";TAB 11-LEN A$;C(I)
  395 IF CP=W THEN GO TO 640
  400 PRINT AT T,Z;"ENTER PURCHASE DATE?(MM/YY)"
  410 INPUT D$(I)
  430 PRINT AT J*3,12;D$(I)
  432 PRINT AT T,Z;E$
  440 PRINT AT T,Z;"INPUT STORE CODE?"
  450 INPUT S$(I)
  460 PRINT AT J*3,18;S$(I)
  480 PRINT AT T,Z;"INPUT LOCATION CODE?"
  490 INPUT L$(I)
  500 PRINT AT T,Z;E$
  510 PRINT AT J*3,26;L$(I)
  560 PRINT AT T,Z;"CHANGES?(Y/N)"
  570 IF INKEY$="Y" THEN GO TO 600
  580 IF INKEY$="N" AND MP<>W THEN GO TO 870
  582 IF INKEY$="N" AND MP=W THEN GO TO 2180
  590 GO TO 570
  591 PRINT AT T,Z;E$
  592 NEXT I
  595 GO TO 100
  600 PRINT AT T,Z;E$
  602 LET CP=W
  603 PRINT AT T,Z;"CHANGE ITEM DESCRIPTION?"
  604 INPUT A$
  605 PRINT AT T,Z;E$
  606 IF A$="" THEN GO TO 609
  607 LET I$(I)=A$
  608 PRINT AT J*3-W,5;I$(I)
  609 PRINT AT T,Z;"CHANGE COST?"
  610 INPUT A$
  620 IF A$="" THEN GO TO 640
  630 GO TO 370
  640 PRINT AT T,Z;"CHANGE PURCHASE DATE?"
  650 INPUT A$
  660 PRINT AT T,Z;E$
  670 IF A$="" THEN GO TO 700
  680 LET D$(I)=A$
  690 PRINT AT J*3,12;D$(I)
  700 PRINT AT T,Z;"CHANGE STORE CODE?"
  710 INPUT A$
  715 PRINT AT T,Z;E$
  720 IF A$="" THEN GO TO 750
  730 LET S$(I)=A$
  740 PRINT AT J*3,18;S$(I)
  750 PRINT AT T,Z;"CHANGE LOCATION CODE?"
  760 INPUT A$
  765 PRINT AT T,Z;E$
  820 IF A$="" AND MP=Z THEN GO TO 560
  825 IF A$="" AND MP=W THEN GO TO 2270
  828 LET L$(I)=A$
  829 PRINT AT J*3,26;L$(I)
  850 IF MP=Z THEN GO TO 560
  860 IF MP=W THEN GO TO 2270
  880 NEXT I
  890 GO TO 4200
  902 LET K=Z
  903 LET S=Z
  905 DIM T(100)
  906 CLS 
  910 PRINT AT Z,Z;"HOW WOULD YOU LIKE TO LIST ITEMS"
  915 PRINT 
  920 PRINT "1. BY ITEM NUMBER"
  925 PRINT 
  930 PRINT "2. BY PRICE"
  935 PRINT 
  940 PRINT "3. BY DATE OF PURCHASE"
  945 PRINT 
  950 PRINT "4. BY STORE"
  955 PRINT 
  960 PRINT "5. BY LOCATION"
  965 PRINT 
  970 PRINT "6. BY ITEM"
  972 PRINT 
  975 PRINT "7. RETURN TO MAIN MENU"
  980 GO TO 2001
 2000 GO TO 101
 2001 IF A=W THEN GO TO 2015
 2002 IF S<>W THEN GO TO 2015
 2004 PRINT AT T,Z;"X-SEARCH?(Y/N)"
 2006 IF INKEY$="Y" THEN GO TO 5000
 2008 IF INKEY$="N" THEN GO TO 2015
 2010 GO TO 2006
 2015 LET S=Z
 2016 LET ST=B1-W
 2017 PRINT AT T,Z;"ENTER LIST TYPE?(1-7)"
 2018 INPUT A
 2019 PRINT AT T,Z;E$
 2020 IF A=W THEN GO TO 2080
 2030 IF A=2 THEN GO TO 2350
 2040 IF A=3 THEN GO TO 2500
 2050 IF A=4 THEN GO TO 2580
 2060 IF A=5 THEN GO TO 2600
 2070 IF A=6 THEN GO TO 2650
 2077 IF A=7 THEN GO TO 100
 2079 GO TO 906
 2090 PRINT AT T,Z;"INPUT ITEM NUMBER?"
 2093 INPUT D
 2094 IF D<P+W OR D>P+100 THEN GO TO 2093
 2101 PRINT AT T,Z;E$
 2102 FOR K=W TO 5
 2103 LET T(K)=D+K-W-P
 2104 NEXT K
 2105 LET K=K-W
 2106 LET F=-4
 2109 CLS 
 2110 IF K=Z THEN GO TO 906
 2111 GO SUB 310
 2112 LET F=F+5
 2113 LET K=K-5
 2114 LET J=Z
 2115 FOR I=F TO F+4
 2117 IF I>100 THEN GO TO 2150
 2120 LET J=J+W
 2125 IF T(I)=Z THEN GO TO 2160
 2130 PRINT AT J*3-1,4-LEN STR$ (T(I)+P);T(I)+P;TAB 5;I$(T(I));AT J*3,5;"$";TAB (11-LEN STR$ C(T(I)));C(T(I));TAB 12;D$(T(I));TAB 18;S$(T(I));TAB 26;L$(T(I))
 2150 NEXT I
 2160 LET MP=W
 2165 LET S=W
 2170 PRINT AT T,Z;"CHANGES?(Y/N)"
 2180 IF INKEY$="Y" THEN GO TO 2210
 2190 IF INKEY$="N" AND K<=Z THEN GO TO 2305
 2191 IF INKEY$="N" AND K>Z THEN GO TO 2295
 2200 GO TO 2180
 2210 PRINT AT T,Z;E$
 2220 PRINT AT T,Z;"ENTER ITEM NUMBER?"
 2225 INPUT I
 2230 IF I<P+W OR I>P+B1-W THEN GO TO 2225
 2231 LET I=I-P
 2232 PRINT AT 18,4-LEN STR$ (I+P);I+P;TAB 5;I$(I);AT 19,5;"$";TAB (11-LEN STR$ C(I));C(I);TAB 12;D$(I);TAB 18;S$(I);TAB 26;L$(I)
 2240 LET J=6.333333
 2260 GO TO 600
 2270 PAUSE Y
 2272 LET F=F-5
 2273 LET MP=Z
 2274 LET K=K+5
 2290 GO TO 2108
 2295 PRINT AT T,Z;"PRESS -C- TO CONTINUE       "
 2297 IF INKEY$="C" THEN GO TO 2108
 2300 GO TO 2297
 2305 PRINT AT T,Z;"PRESS -M- FOR MENU"
 2310 IF INKEY$="M" THEN GO TO 906
 2320 GO TO 2305
 2350 PRINT AT T,Z;"INPUT PRICE RANGE........"
 2355 PAUSE Y
 2356 PRINT AT T,Z;E$
 2357 PRINT AT T,Z;"INPUT UPPER LIMIT?" 
 2360 INPUT U
 2365 PRINT AT T,Z;E$
 2370 PRINT AT T,Z;"INPUT LOWER LIMIT?"
 2380 INPUT LL
 2390 PRINT AT T,Z;E$
 2395 LET K=Z
 2396 FOR Q=W TO ST
 2397 IF S=Z THEN LET I=Q
 2398 IF S=W THEN LET I=T(Q)
 2401 IF A=2 THEN GO TO 2410
 2402 IF A=3 THEN GO TO 2412
 2403 IF A=4 THEN GO TO 2416
 2404 IF A=5 THEN GO TO 2418
 2405 IF A=6 THEN GO TO 2420
 2410 IF C(I)>U OR C(I)<LL THEN GO TO 2440
 2411 GO TO 2430
 2412 IF VAL D$(I,4 TO 5)>VAL B$(4 TO 5) OR VAL D$(I,4 TO 5)<VAL G$(4 TO 5) THEN GO TO 2440
 2413 IF (VAL D$(I,1 TO 2)<VAL G$(1 TO 2) AND VAL D$(I,4 TO 5)=VAL G$(4 TO 5)) THEN GO TO 2440
 2414 IF VAL D$(I,1 TO 2)>VAL B$(1 TO 2) AND VAL D$(I,4 TO 5)=VAL B$(4 TO 5) THEN GO TO 2440
 2415 GO TO 2430
 2416 IF A$<>S$(I,1 TO LS) THEN GO TO 2440
 2417 GO TO 2430
 2418 IF A$<>L$(I,1 TO LS) THEN GO TO 2440
 2419 GO TO 2430
 2420 FOR O=1 TO 28-LS
 2421 IF A$=I$(I,O TO O+LS-1) THEN GO TO 2430
 2422 NEXT O
 2425 GO TO 2440
 2430 LET K=K+W
 2435 LET T(K)=I
 2440 NEXT Q
 2442 LET T(K+W)=Z
 2446 LET S=W
 2450 PRINT AT 20,Z;K;" MATCHES FOUND"
 2452 PAUSE Y
 2453 PRINT AT T,Z;"LIST?(Y/N)"
 2454 IF INKEY$="Y" THEN GO TO 2466
 2456 IF INKEY$="N" THEN GO TO 906
 2457 GO TO 2454
 2468 CLS 
 2470 GO TO 2106
 2500 PRINT AT T,Z;"INPUT DATE OF PURCHASE RANGE...."
 2505 PAUSE Y
 2510 PRINT AT T,Z;"INPUT EARLIEST DATE FIRST?MM/YY"
 2515 INPUT G$
 2520 PRINT AT T,Z;E$
 2530 PRINT AT T,Z;"INPUT LATER DATE?(MM/YY)"
 2540 INPUT B$
 2550 GO TO 2385
 2580 PRINT AT T,Z;"INPUT STORE CODE?"
 2585 INPUT A$
 2587 LET LS=LEN A$
 2590 GO TO 2385
 2600 PRINT AT T,Z;"INPUT LOCATION CODE?"
 2610 INPUT A$
 2615 LET LS=LEN A$
 2620 GO TO 2385
 2650 PRINT AT T,Z;"INPUT ITEM NAME?"
 2660 INPUT A$
 2665 LET LS=LEN A$
 2670 GO TO 2385
 2731 CLS 
 2732 PRINT AT Z,Z;"   CODE";TAB 19;"STORE";AT W,Z;"----------  --------------------"
 2735 FOR I=1 TO 18
 2750 PRINT AT I+W,2-LEN STR$ I;I;TAB 2;".";U$(I);TAB 13;V$(I)
 2770 NEXT I
 2785 PRINT AT T,Z;"CHANGES?(Y/N)    "
 2790 IF INKEY$="Y" THEN GO TO 2820
 2800 IF INKEY$="N" THEN GO TO 2920
 2810 GO TO 2790
 2820 PRINT AT T,Z;"INPUT CODE NUMBER?"
 2830 INPUT I
 2835 IF I>18 OR I<W THEN GO TO 2820
 2840 PRINT AT T,Z;"INPUT STORE CODE?    "
 2850 INPUT U$(I)
 2853 PRINT AT I+W,3;U$(I)
 2860 PRINT AT T,Z;"INPUT STORE NAME?    "
 2863 INPUT V$(I)
 2865 PRINT AT I+W,13;V$(I)
 2875 GO TO 2785
 2930 PRINT AT T,Z;"PRESS -M- FOR MENU        "
 2970 IF INKEY$="M" THEN GO TO 100
 2980 GO TO 2970
 3000 PRINT AT T,Z;"SAVE NEW DATA?(Y/N)"
 3001 IF INKEY$="Y" THEN GO TO 3004
 3002 IF INKEY$="N" THEN GO TO 4070
 3003 GO TO 3001
 3004 CLS 
 3005 PRINT AT 2,Z;"1.POSITION TAPE AT A CLEAR        SPACE OR A PLACE TO BE          RECORDED OVER."
 3010 PRINT AT 6,Z;"2.RECORD YOUR VOICE.....SAY       INSURANCE INVENTORY VERSION--"
 3020 PRINT AT 9,Z;"3.HOOK LEADS UP.......FROM MIC    OF COMPUTER TO MIC OF RECORDER"
 3030 PRINT AT 12,Z;"4.PRESS  RECORD  ON RECORDER."
 3040 PRINT AT 15,Z;"5. PRESS -S-"
 3050 IF INKEY$="S" THEN GO TO 3070
 3060 GO TO 3050
 3070 SAVE "INS" LINE 3
 3075 CLS 
 3080 PRINT AT W,Z;"**DATA HAS BEEN SAVED TO TAPE**"
 3090 PRINT "VERIFY SAVE"
 4000 PRINT AT 5,Z;"PRESS -M- FOR MENU"
 4005 PRINT 
 4010 PRINT "PRESS -S- TO SAVE AGAIN"
 4015 PRINT 
 4020 PRINT "PRESS -E- TO END RUN"
 4030 IF INKEY$="M" THEN GO TO W
 4040 IF INKEY$="S" THEN GO TO 3004
 4050 IF INKEY$="E" THEN GO TO 4070
 4060 GO TO 4030
 4070 PRINT AT T,Z;"END OF RUN         "
 4080 STOP 
 4200 CLS 
 4210 PRINT AT T,Z;"ALL 100 ITEMS ARE INPUTTED"
 4220 PAUSE Y
 4230 GO TO 100
 4300 CLS 
 4310 PRINT AT 2,6;"GENERAL INFORMATION"
 4320 PRINT AT 3,6;"-------------------"
 4330 PRINT AT 5,W;"1.POLICY NO.  ";Z$
 4340 PRINT AT 7,W;"2.INS. CO.  ";Y$
 4350 PRINT AT 9,W;"3.AGENTS NAME  ";M$
 4360 PRINT AT 11,W;"4.AGENTS PH. NO.  ";P$
 4370 PRINT AT 13,W;"5.POLICY EXP. DATE  ";N$
 4375 PRINT AT 15,W;"6.LAST REVISION DATE  ";R$
 4380 PRINT AT T,Z;"CHANGES?(Y/N)"
 4390 IF INKEY$="Y" THEN GO TO 4420
 4410 IF INKEY$="N" THEN GO TO 2930
 4415 GO TO 4390
 4420 PRINT AT T,Z;"WHICH ITEM?    "
 4430 INPUT A
 4440 PRINT AT T,Z;"ENTER NEW INFORMATION?"
 4460 IF A=W THEN INPUT Z$
 4470 IF A=2 THEN INPUT Y$
 4480 IF A=3 THEN INPUT M$
 4490 IF A=4 THEN INPUT P$
 4500 IF A=5 THEN INPUT N$
 4505 IF A=6 THEN INPUT R$
 4510 GO TO 4300
 5100 FOR I=W TO 100
 5110 IF T(I)=Z THEN GO TO 5120
 5115 NEXT I
 5120 LET ST=I-W
 5130 GO TO 2017
 6000 LET W=1
 6001 LET Y=150
 6002 LET T=21
 6003 LET B1=1
 6004 LET Z=0
 6005 LET A=5
 6006 LET Z$="MAX 16 CHARACTER"
 6007 LET M$="MAX 13 CHARAC"
 6008 LET P$="MAX 13 CHARAC"
 6009 LET N$="MAX 8 CH"
 6010 LET R$="MAX 8 CH"
 6011 LET Y$="MAX 18 CHARACTERS "
 6012 DIM I$(100,27)
 6013 LET E$="                                "
 6014 DIM C(100)
 6015 DIM D$(100,5)
 6016 DIM S$(100,7)
 6017 DIM L$(100,6)
 6018 LET A$="      "
 6019 LET U=900000
 6020 LET LL=1
 6022 DIM U$(18,7)
 6023 DIM V$(18,19)
 7000 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