UNJUST Version 1.2 Gene Pizzetta November 23, 1990 Have you ever tried to edit with WordStar a document that is justified with ASCII spaces? If so, here's a partial answer. UNJUST is a ZCPR3 utility that replaces multiple white-space character strings in text files with a single space. It removes all soft spaces and tab characters. It enforces two spaces after periods and removes all white-space at the beginning and (optionally) end of lines. Under ZDDOS and ZSDOS create date stamps are preserved. USAGE: UNJUST {dir:}infile {dir:}{outfile} {{/}options} An infile name is required. If no outfile name is given, it will have the same name as the infile. If a file exists with the same name as the outfile, it will be renamed to filetype of BAK. Filenames beginning with a slash must be preceded by a DU specification. OPTIONS: An a preceding slash is necessary only if a second file specification is not given. Q Toggles quiet mode. Quiet mode is set by the ZCPR3 quiet flag or by a configuration byte (see configuration below). Option Q toggles the current mode. T Leaves a single trailing space (except two spaces after a period, question mark, or exclamation point) at the end of lines that have existing trailing spaces. UNJUST replaces strings of hard and soft spaces and tabs with a single hard space (20h), except that white-space strings after a period, question marks, and exclamation points are reduced to two hard spaces. (If those punctuation marks had no space after them in the original file, no space will be added.) Leading spaces on a line are eliminated completely. Trailing spaces are eliminated by default, but the T option allows leaving spaces at the end of the line (which is desirable for ZDE and WordStar document files). Blocks of text delimited by a special tag character will be copied without changes. The tag character, as distributed, is ^P, but it can be changed (see configuration section below). Under ZDDOS and ZSDOS file create dates are preserved. If the input file has no create date, the old modification date will become the create date of the output file. If the input file has neither a create nor a modification date, the output file will have the current date. To unjustify a document, first scan the document with your favorite text editor to see if there are any sections, such as charts and tables, in which you want the spacing preserved. Mark the beginning and end of those sections with the tag character (^P, unless you change it). Then run the file through UNJUST. UNJUST will automatically remove the tag characters, but the text between them will be unchanged. You may then edit the file with WordStar. You will have to re- center titles and you will still have to remove hard carriage returns with ^^. On error UNJUST will set the program error flag to standard codes as listed in Z34ERR.LIB and invoke the error handler, if one is running. CONFIGURATION: UNJUST is configured using the accompanying UNJUSTnn.CFG file and the ZCNFG utility. Do not rename the CFG file, so ZCNFG will always be able to find it, even if you change the name of UNJUST. UNJUST will run fine "out of the box", but if you wish you can use ZCNFG to make quiet mode the default, to preserve trailing spaces as the default, and to select a new tag character. The current quiet mode and trailing space status, and the tag character are reflected on the usage screen. HISTORY: Version 1.2 -- November 23, 1990 -- Gene Pizzetta Increased size of input buffer and made several other changes to speed up processing. Now removes trailing spaces. T option allows leaving a single trailing space on lines where trailing spaces already exist (for ZDE compatibility). Also now enforces two spaces after question marks and exclamation points. Now properly handles files that do not end with a ^Z. Corrected bug that caused two sectors of ^Z's to be added to a file if it ended exactly on a sector boundary. Implemented several suggestions from Howard Goldstein to improve the code. Version 1.1 -- October 5, 1990 -- Gene Pizzetta Corrected bugs that caused unpredictable destination for outfile if no filespec was given and a jump to the wrong error routine if the input file was not found. Now checks for sufficient TPA space. Several other code optimizations, mostly at the suggestion of Howard Goldstein. (Thanks, Howard.) Version 1.0 -- September 22, 1990 -- Gene Pizzetta Initial release. To report bugs or make suggestions: Gene Pizzetta 481 Revere Street Revere, MA 02151 Newton Centre Z-Node: (617) 965-7259 Ladera Z-Node: (213) 670-9465 GEnie: E.PIZZETTA Voice: (617) 284-0891