WordStar file utility -- December, 1987 Version 2.0 Version 1.0 Copyright 1985 by Dean A. Fields Version 2.0 Copyright 1987 by Ellis B. Levin TBL.COM Version 2.0 handles text of multiple lines, adjusting for each different text length. It is designed for legal briefs and other documents where it is necessary to index multiple lines of text. It will handle text of up to 498 characters. In addition it contains two other modifications from version 1.0: First, it does not put the table of contents text in upper case. Second, it puts a blank line between each text in the table of contents. This program is released to the Public Domain and may be freely distributed and copied, but may not be sold without the authors written permission. All Rights Reserved Written in TURBO PASCAL Ver. 3.0 Version 1.0 Tested on a: COMPAQ MsDos 3.1 KAYPRO 4-84 CP/M 2.2 To use this program, type the program name, TBLCTENT, at the DOS prompt, and press the return key. The program will first announce itself, and then prompt for the name of the file that the table of content is to be created from. This program creates a Table of Contents for a WordStar document file. TBLCTENT looks for control codes, and takes whatever is between them and places it in the table of contents file. The control codes are, ^R to start and stop inclusion into the table of contents file. They are placed in the file by entering a ^P^R at the beginning and end of the text you want included into the table of contents file. The ^R's should never have WordStar dot commands between them. The name of the table of contents file is the same as the input document, except the file type which is ".TBC". The maximum number of characters allowed in a Table of Content entry is 55, if more then 55 characters appear between the ^R's, then the Table of Content entry is truncated to 55 characters. After you enter the file name that the table of content is to be created from, TBLCTENT will try to open that file for input. If the file can not be opened (ie. because it can not be found or something) the condition is reported and you are reprompted for an input file name. This program can be aborted at anytime by a ^C. If the input file name is found, then the output file (Table of Content file) is checked for. If the output file already exist, you are given the option of either deleting it (overwritting it ), or canceling the program. If you delete it, then processing continues as if the file had never existed. During processing, TBLCTENT reports pages that it has scanned for table of content entries; so you can tell approximately how far you are in the input document. Pages covered by a .OP command are not counted. The following describes how the WordStar .OP, .PA, and .PN n commands are treated by TBLCTENT: .OP causes the program to stop searching for Table of Content information, because .OP turns off page number and therefore there is no page number to associate to the Table of Content entry, and thus no reason to report a Table of Content entry. Table of Content searching resumes with the next .PN n command encountered. .PA causes the page number variable to be incremented .PN n causes the page number variable to be set to number n of the .PN n command. n can not be larger than 9999, unless provisions are made to do the following: 1) - MaxNum in the CONST section at the beginning of the program must be changed to accommodate the new size 2) - the "CASE pndx of" structure in Procedure test_line must be changed to handle the larger page numbers 3) - Procedure translate_line must be modified to accommodate the new TBC line format, which includes balancing and centering of the TBC entry. Once the Table of Content file has been created, it can be edited with WordStar to add in printer control codes for your specific type of printer. On some machines the Table of Content file will contain a few ^@'s at the end of the file; The ^@'s do not print. You can ignore them or delete them it makes no difference.