home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CP/M
/
CPM_CDROM.iso
/
enterprs
/
cpm
/
utils
/
f
/
filt84.lbr
/
FILT84.HZP
/
FILT84.HLP
Wrap
Text File
|
1992-05-09
|
11KB
|
238 lines
;
FILT
Version 8.4
Gene Pizzetta
May 9, 1992
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. FILT
will also run under vanilla CP/M, but can only access the current user area
in that case (and, of course, the Z features will not work).
U Usage E Errors
O Options C Configuration
S Screen Display H History
D Date Stamping B Bug Reports
:U
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, but including form 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.
:O
MODE OPTIONS
Only one mode option should be given. If more than one is given, the last
one found will be used.
A ASCII Text. This is the default mode (see USAGE).
S Source code. Identical to ASCII text mode, except that quoted
strings are not retabbed, and even single spaces are replaced by
tabs until a semi-colon is encountered.
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.
TABBING OPTIONS
Only one tabbing option should be given. If more than one is given, the
last one found will be used.
T Re-tab. Tabs are expanded to spaces as the source file is read,
and then spaces are replaced with tabs (where possible) as the
output file is written. This is the default tabbing mode.
E Expand tabs. Tabs are expanded to spaces as the source file is
read, but the file is not retabbed.
K Keep tabs as found. Tabs in the source file are not expanded to
spaces, nor are new tabs added on output. (Trailing tabs at the
ends of lines are still removed, however.)
OTHER OPTIONS
F Retain form feeds. Normally FILT removes form feeds from ASCII
text and source code files. With this option existing form feeds
will be kept. (Form feeds are always kept in WordStar modes.)
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.
A leading slash is required before the option list only if the options are
not the third token in the command tail, but is allowed in any case. All
options can be configured as defaults (see CONFIGURATION).
:S
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.
:D
DATE STAMPING
Under ZSDOS the create date stamp of the source file will be transferred to
the destination file.
If the source file has no create date, but has a modify date, the modify
date will become the create date of the destination file, so the earliest
available date is preserved.
If the source file has neither a create date nor a modify date, no date
stamp transfer is done.
:E
ERRORS
On error the ZCPR3 program error flag is set as follows:
2 Invalid directory
4 File read error or file close error
8 Ambiguous filename
10 Source file not found
11 No disk or directory space
19 Invalid option
255 User abort (^C)
Whether a user abort via ^C generates an error is a configurable option
(see CONFIGURATION). All errors cause the error handler to be invoked.
:C
CONFIGURATION
Although distributed ready-to-run under both ZCPR3 and vanilla CP/M, FILT
offers several configuration options for those not satisfied with the
defaults. The default modes for all the command line options can be
changed.
In addition, the running line count progress report, which FILT normally
displays while it is working, can be suppressed.
FILT can also be configured to generate an error when the user aborts via
^C, thus invoking the error handler. This feature can be handy for halting
SUB and ZEX batch operations.
Configuration is accomplished using Al Hawley's ZCNFG with the accompanying
FILTnn.CFG file. Built-in help screens explain the configuration choices.
If you don't change the name of the CFG file, ZCNFG will always be able to
find it even if you change the name of FILT.
:H
HISTORY
Version 8.4 -- May 9, 1992 -- Gene Pizzetta
At Howard Goldstein's suggestion, I added a new command line option to
allow retaining existing form feeds in ASCII text and source code
files. This new option is also configurable as the default.
Appropriate modifications have been made to FILT84.CFG and to
FILT84.HLP.
Version 8.3 -- May 3, 1992 -- Gene Pizzetta
On systems without date stamping, FILT was trying to rename files in
the wrong directory. That has been fixed. Thanks to Ed Flinn and
Howard Goldstein for finding this bug. While I was at it, I have
changed the DOC file to a standard ZCPR3 help file.
Version 8.2 -- March 3, 1992 -- Gene Pizzetta
A request from Howard Goldstein has motivated me to add the ability to
keep tabs in the document as originally found. This three-way
operation has resulted in two new command line options: E to expand
tabs to spaces and K to keep them as found. Trailing tabs will still
be removed. Whether a user abort via ^C generates an error is now
configurable. Should now be CP/M compatible in the current user area
only.
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.
:B
BUG REPORTS AND SUGGESTIONS
Please report any bugs as soon as possible, and make suggestions at your
leisure:
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