ZX Data Finder

Products: ZX Data Finder
Developer(s): Thomas B. Woods
Date: 198
Type: Program
Platform(s): TS 1000
Tags: Database

A searchable free-text file. Each entry is four lines typed in at the keyboard, and you find entries by typing any word or phrase: a machine code routine scans the whole file and shows each entry that contains it, one at a time. The title screen reads “ZX/FILE FINDER”; enter a search, or A to add a new entry. After a match, ENTER continues the search, R starts it again from the top of the file, and N begins a new search.

This copy is file 2 on side B of the CassFile2 cassette (#57780), where the handwritten label calls it “Linear Search”. The listing carries no title or author credit beyond the on-screen name. It is linked to the ZX Data Finder product by Thomas B. Woods.

Program Analysis

Program Structure

  • Line 1: a REM that holds the current search string. Lines 50–70 POKE it in from address 16514, followed by an inverse full stop as an end marker.
  • Line 5: a REM holding the Z80 search routine, called with USR 16552 at line 122.
  • Line 11: a REM about 13,000 characters long that is the file itself. New entries are POKEd into it from address 16658, starting with *, with the four lines separated by quote characters (code 192) and the entry closed by another * (code 23). The variable P counts the bytes used.
  • Lines 80–110: POKE the file length and a start pointer into the routine before each search.
  • Lines 125–250: print the matching entry, starting a new line at each quote character and stopping at the closing *, and handle the ENTER / R / N choices.
  • Lines 500–660: the add routine, with a chance to correct the four lines before they are logged.
  • Lines 1000–2030: a separate memory monitor reached with GOTO 1000. It steps through memory from 16507 showing each address, PEEK value and character, with options to POKE a value, go to an address, back up or stop.

Notable Techniques

  • The data lives inside a REM line, so it is saved with the program and needs no arrays or variables except the byte count P.
  • The search is done in machine code over the raw bytes, so any text, not only a key field, can be found.
  • Line 150 picks between a line break and the end of the entry with one computed GOTO 200+(20*(PEEK (Y+1)=23)).

Potential Issues

  • Line 12 sets P to 0. If the program is started with RUN or from the top, the file appears empty to the search and new entries are written over the old ones from the start. It has to be restarted with GOTO 14 to keep the file.
  • There is no check on the length of the file, so adding entries beyond the space in the line 11 REM would POKE past it into the rest of the program.
  • Entries cannot be edited or deleted except through the memory monitor.

Appears On

One individual’s cassette containing a number of programs. It is a Radio Shack tape labelled “CASSFILE #2” and marked “TS1&rdquo

Related Products

High capacity file manager; versatile catalog/index/reference tool; edit, search, and display routines explained in text; a course on file and data storage techniques.

Image Gallery

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