ZDB Version 1.1b Joseph I. Mortensen February 1, 1981 I. Copyright Notice ZDB is copyrighted (C) 1990, 1991 by Joseph I. Mortensen. It is offered to the Z community for whatever use anyone has for it except selling it or in any way representing it as your own work. Copy it, use it, pass it around, or modify it to your own taste and needs. II. Description ZDB is the Z-System Database, a name and address file manager. Its claims to fame are: * Size (8K) and Speed (written in Z80 assembler) * Use of Z-system extended TCAP and VLIB4D graphics routines * Automatic dating of entries * Compatibility with almost all systems running ZCPR3 * Simple one-key mnemonic command structure * Menu line always displayed * Latest sort routines by Joe Wright from SYSLIB43C * Express search for last/first name or zipcode/last name * Search for any string in any field in any record * Convenient paging through the file in browse mode * Records always displayed in sorted order * Sorting on either of two indexes & fast switching of sort index * Writing of sorted file, purging of deleted records * On-screen editing using WordStar-style commands * Insert/overwrite toggle for editing * Multiple output options for labels, envelopes, and directory * Writing of comma-delimited format ASCII file for MailMerge * Selective label output on any of four keys (such as zipcode) * User-configurable printer codes, label sizes, and options ZDB is fully Z-System dependent. If you lack a clock, ZDB allows for manual entry of the date. ZDB does not require an RCP or FCP or IOP to work. It does need the extended TCAP with the 13 graphics characters compatible with VLIB4D graphics routines. ZDB was edited with ZDE, assembled with ZMAC, and linked with ZML using DSLIB, VLIB, Z3LIB, and SYSLIB routines. I developed it on my venerable Kaypro II'83 -- 5 MHz with 20 Meg Seagate, TurboROM, Rembrandt (from Spectre Technologies) character ROM for primitive graphics, Kenmore clock, and Z-System. Please report bugs and make suggestions for improvement. I may be contacted on Compuserve (70037,3161), GEnie (J.MORTENSEN3), Ladera ZNode, Voice 517-835-6923, or by mail at 4214 Chelsea Ct., Midland, MI 48640. Terry Hazen of Los Gatos, CA, has made major contributions to this project. Almost every part of the source code has bene- fitted from his professional touch. The result is far more efficient code, reduced size, and added features. Without his generous help ZDB would be fatter, slower, and less useful. I began this project after purchasing Al Hawley's great ZMAC/ZML package last spring. With no background in programming in assembler I needed all the help I could get. Terry has been a great and patient tutor through the mail and over the modem. III. Installation If you're running ZCPR3.3+, ZDB needs no ZCPR3 installation, but if you're running ZCPR3.0, you need to install ZDB in your usual way. Before using ZDB you will need to patch it with your own return address. See section VI on patching at the end of this DOC file. Use ZCNFG to configure your copy of ZDB with your printer codes and other preferences. IV. Using ZDB Entering 'ZDB /' at the command line will produce a help message. If you also enter a data file name, ZDB will look for it, create it if it does not exist, and display either a blank record (if it's a new file) or the first non-erased one in the file. If no file name is specified, ZDB will use ZDB.DTA as the default data file name. If you don't have an internal clock (or have a clock module loaded), ZDB will ask for the current date. If you wish to quit at this point, enter ^C at any time while entering the date. The menu line at the bottom of the screen displays the ZDB commands. 1. Add 'A' for Add is the command used to enter new records. The display is cleared and the cursor placed in the first field ready for your entry. Each field is marked off with angle brackets --> < -- so you know how much space you have. If you try to enter more characters than allowed in any field, you will get beeped at, but you can back up and fix things. ^X, TAB or RETURN moves to the next field. ^E moves to the previous one. ^S/^D move cursor left/right. ^A/^F move cursor one word left/right. ZDB intercepts U/D/R/L terminal arrow keys and interprets them properly. ^G deletes the character at the cursor and moves the remainder of the line one character left. ^Y deletes from character at the cursor to the end of line. ^V toggles the character insert mode, allowing you to insert characters at the current cursor position, shifting the rest of the line to the right. If you go past the first or last field, you are given a choice of redoing the entry to make corrections or saving it. Press ESC or ^W at any point to finish the entry. Entering ^Q at any point will abort the entry without saving the results. Boxes near the bottom of the screen display editing keys and give prompts. On completion of a new entry you are given the option of continuing to add new records or quitting. When you finish entering new records, the index will automatically be sorted. If you wish to ensure that a header record that describes the data file is always displayed as the first record when the file is sorted on either index, enter several spaces as the initial first and last name characters and make sure the ZIP Code field has no entry. See ZDB.DTA. 2. Delete Pressing 'D' deletes the displayed record from the file. You are given a chance to say no if you mistakenly press the 'D'. The record is filled with nulls except for the first byte which is 0FFH, marking it as a deleted record. Deleted records are dropped when a new sorted file is written. Deleting a record does not change the record count in the header line of the screen since the deleted record is still in the file until a new sorted file is written. ZDB does not display or print deleted records. 3. Edit 'E' for Edit works exactly like Add except that it is for up- dating existing information. You cannot edit the date. It is changed automatically. As in Add, ESC or ^W exits the editing session and saves the edited record and ^Q aborts the editing session and restores the unedited record. 4. Find ZDB has two search routines. 'X' (Express) Find searches the index in memory for a match. Because the index is in memory, the Express search is very fast. When the index is sorted by last and first names, each index record is made up of the first 10 characters of the last name and the first 4 characters of the first name. When the index is sorted by ZIP Code, each record contains the 10 characters in the ZIP Code field and the first 4 characters in the last name. The other Find works on any field but is slower, as it must read each record and search it for a match. Press 'F' for this one. You may enter up to ten characters in the search string. Find is not case sensitive and partial strings are fine. Entering "jo" to search for "Jones" will get the job done. You can enter more than one word, e.g., "St. Paul," as long as they are in the same field. If the search string is found in any field of any record, ZDB displays that record on the screen. You may then opt to end the search or continue it. If there's no match, ZDB tells you so. Even in fairly large files, Find works quickly, but Express Find is much faster. Express Search and Find are also available under Output for printing labels and envelopes. 5. Previous, Next Previous and Next are for browsing through the file. Pressing '<', or ',' both work for Previous and '>', or '.' both work for Next. Records are displayed in sorted index order, so if the file is not in sorted order, the record numbers appearing in the header line may not be in sequence. Records are displayed in a circular wrap-around manner. If you are going backwards through the file and reach the first record, another Previous command wraps to the end of the file. "Next" acts in a similar fashion when it reaches the end of the file. Two other commands, not on the menu, are 'T' (Top) and 'B' (Bottom). They quickly take you to the first or last record in the file. 6. Output Output has submenus offering a choice of printing labels, envelopes, and a directory, or producing a comma-delimited format ASCII datafile. The label option gives the further choice of printing a single label, those which match a key, multiple copies, or the entire file. When you select 'Key', you will be asked to select the city, state, zip code or comments2 fields for matching the specified key. If you want to make labels for your Christmas card list, you could use 'CL' in the Comments2 field as your code. There's room for lots of imagination for the use of this feature. 25 characters are searched in the Comments2 field so many two-letter codes can be specified. Both the label and envelope option allow you to use Find, Xfind, or Next before issuing the print command. Printing (and writing of the CDF file) is done in sorted index order. For bulk mailings, use the ZIP Code index feature to print labels in sorted ZIP Code order. A return address for the envelope is also hard coded in ZDB and should be changed for your use or eliminated. See the section below on patching. The CDF file routine uses a large output buffer and does its job very quickly. The resulting file is in the currently logged directory. It is an ASCII file and can be edited with ZDE or any other word processor. It is compatible with WordStar's and many other programs, both CP/M and MSDOS. The output file uses the current data file name with filetype CDF. 7. Index The Index command allows you to specify the field to use to make up the index. The index is automatically maintained in sorted order and determines the order in which the records are displayed or printed. The index display informs you of the current index type. The Last Name index key produces an index record for each file record consisting of the first 10 characters of the last name and the first 4 characters of the first name. The ZIP Code index key produces index records consisting of the 10 ZIP Code field characters and the first 4 characters of the last name. Since you always have at least the initial 4 last name characters, Express Finds using up to the first 4 last name characters will work no matter which index is currently in use. 8. Sort The Sort command (^S) writes a new file in the current directory with the original data file name having its records in the order of the current sorted index. The old file is retained as a backup with the name BACKUP.DTA. If a previous BACKUP.DTA file is present, it is deleted. Deleted records are purged when Sort writes a new file. V. Miscellaneous ZDB's data file uses a 256 byte record so that each one is on a page boundary. There is no header to the file. Disk capacity is the real world limiter on file size. On a 390K floppy, ZDB itself will take 8K. Divide the remaining 382K by 2 (you need twice the space in order to do a sort) to get maximum file size - - in this case 764 records of 256 bytes. On a hard disk, of course, you hardly need to worry about file size. The index requires 16 bytes per record plus 2 bytes per record for an order table. Writing the CDF ASCII file requires a 16K buffer above the index and order table. A system with 45K or more of TPA should handle a ZDB file of 1200 records without overwriting the CCP. If you never need a CDF file, ZDB can handle about 2500 records, depending on TPA size. Sometimes the screen display may get out of whack. The main menu has an undisplayed command -- ^R (Control-R) -- which refreshes the screen display. VI. Patching A .CFG file is supplied with ZDB to do all printer and other configuration except for the return address. Use ZCNFG14 or later with the .CFG file. For convenience a patch file (ZDB11.PAT) has been prepared. It is in ZDBSRC.LBR.