FILT Version 8.1 Gene Pizzetta September 30, 1991 Copyright (c) 1984, 1985, 1986 by Irv Hoff FILT, originally written by Irv Hoff, is a ZCPR3 utility that sets or expands tabs and removes several types of unwanted characters in ASCII text, WordStar documents, or assembler source code files. A summary of what the program found and what it did is presented upon completion. USAGE: FILT {dir:}infile {{dir:}outfile} {{/}options} Only the input filename is required. If no output filename is given, the default is the name of the input file. Any existing file with the same name in the destination directory will be renamed to filetype BAK. If no DIR or DU specifications are given, the current directory is assumed. As distributed, FILT defaults to ASCII text mode. Control characters (except carriage returns and line feeds) are removed, high-bits are reset, and trailing spaces and tabs are removed. Lines ending with only a line feed will have a carriage return inserted. All tabs are expanded to spaces and then the file is retabbed in 8-column increments as long as a tab will replace two or more spaces. MODE OPTIONS: Only one mode option should be given. If more than one is given, the last one found will be used. S Source code. Quoted strings are not retabbed, but even single spaces are replaced by tabs until a semi-colon is encountered. A ASCII Text. This is the default mode (see above). W WordStar, no dot commands. Lines beginning with a period (dot commands) are removed, but ".pa" commands are replaced by form feeds and existing form feeds are retained. Soft carriage returns and binding spaces are converted to normal. Soft hyphens at the end of a line are made normal, but other soft hyphens (which are control characters) are removed. D WordStar, with dot commands. Identical to option W, above, except that lines beginning with a period (dot commands) are retained and ".pa" commands are not replaced by form feeds. OTHER OPTIONS: T Don't use tabs. Tabs are expanded to spaces, but the file is not retabbed. Q Quiet mode toggle. If the ZCPR3 quiet flag is on, FILT defaults to quiet mode. In that case, this option puts FILT in verbose mode. If the quiet flag is off, this option puts FILT into quiet mode. In quiet mode all screen output is suppressed except error messages and the usage screen. All options can be configured as the defaults using ZCNFG and the FILTn.CFG file. SCREEN DISPLAY: By default an incrementing line count is displayed while FILT is working. The final summary screen varies depending on the current file mode. The default summary shows counts of the total lines in the file, original spaces, original tabs, current spaces, current tabs, form feeds deleted, high bits zeroed, control characters deleted, orphan line feeds fixed, and trailing spaces deleted. In WordStar mode, the display shows the number of form feeds present, since they are not deleted. It also adds counts for dot commands deleted (with option W), dot commands retained (with option D), soft carriage returns fixed, soft hyphens fixed, and binding spaces fixed. Under ZSDOS or ZDDOS, FILT will transfer the create date stamp from the source file to the new file. If the source file has no create date, the source file's modify date will be used instead. On error, such as an invalid directory or a file not found, FILT sets the program error flag to the standard codes listed in Z34ERR.LIB and invokes the error handler. Even a user abort via ^C invokes the error handler so a pending SUB or ZEX operation can be aborted. HISTORY: Version 8.1 -- September 30, 1991 -- Gene Pizzetta FILT did not check for ambiguous filenames (and never has), which could cause a small disaster. It checks now. Made display of line count progress reports into a configurable option. Version 8.0 -- September 10, 1991 -- Gene Pizzetta Disassembled enough to change to a relocatable file (it was easy after working on JUSTIFY). Changed to Z80 opcodes to partially compensate for space used by additional features. Replaced some routines with library routines. Now allows destination directory without destination filename. Changed key options to command line entry. Changed some messages to make them more descriptive. Added DU support, intelligent usage screen, error flag setting, error handler invocation, quiet mode, and ZCNFG configuration. Under ZSDOS and ZDDOS file create date stamps are transferred to the new file. Incorporates some code efficiencies suggested by Bruce Morgen for JUSTIFY. The hardest part of this conversion was deciding how to make those various interactively chosen modes into a group of logical command line options. I hope I've succeeded. Version 7.0a -- May 11, 1986 -- Irv Hoff W6FFC When filtering WordStar files FILT7 was checking for unwanted control characters too soon, thus ignoring space breaks and soft-hyphens. The summary report then indicated none were found. That has been fixed with FILT7A. Evidently these characters are seldom used in WordStar files, as I had to make some special files to even test this feature. This would be verified to some extent by nobody calling this to our attention even though the program has been available for several years now. (WordStar uses 0Fh for space breaks and 1Fh for soft-hyphens.) Version 7.0 -- April 27, 1985 -- Irv Hoff Accepts lines up to 255 characters long (vice 128). Insures last line has CR-LF to allow normal processing. Version 6.0 -- March 7, 1985 -- Irv Hoff Added tab option if in Text mode. Fixed ERXIT so external file is not deleted unless a 'Y' is used. Version 5.0 -- November 20, 1984 -- Irv Hoff Initial version, similar style to FORM5, NEAT5 and TABS5. Please report bugs or make suggestions: Gene Pizzetta 481 Revere St. Revere, MA 02151 Voice: (617) 284-0891 Newton Centre Z-Node: (617) 965-7259 Ladera Z-Node Central: (213) 670-9465