[Date Prev][Date Next][Subject Prev][Subject Next][ Date Index][ Subject Index]

Re: Automated Clean-Up of Ragged Text ?



Hi, Jordan Fox. If I may jump in: The xyWrite 3
overlay !xyWise includes a few runtime libraries that
programs can run as the need arises for procedures
they contain, except for one library that !xyWise
runs before each pgm. This library contains basic
procs that most pgms need during their run and
if they don't may overwrite. Two of those basic
procs are proc {is29}:

	{lbR}XC {if@not({er})}{glR}{ei}{pv11}

and proc {is11}:

	GH ER _XC BC ci _

In case their purpose isn't self-evident, proc {is11}
is a shortcut for use with a set of wholesale one-time
ci's that use _ as delimiter. It completes and executes
one ci and sets up a new one:
	BC ci _A_a{pv11}B_b{pv11}C_c{pv11}D_d{pv11}
Proc {is29} executes a command repeatedly till error,
then sets up a new proc {is11} that in and of itself
is superfluous, but when used within a set of wholesale
ci's saves the pgm from having to issue a new "BC ci _".
	BC ci _A_a{pv11}B_b{pv11}C_c{pv11} _ _{pv29}D_d{pv11}

As applied to the needs you state, this xyW4 macro
that uses those procs might be helpful (where [XXX]
represents ascii control chars the macro uses to
temporarily mask newlines--the compound character
xyWrite docs and some users call "carriage return,"
\n = the xpl CMline newline, and \t = tab):

	{if@siz({va$fp})<1}{pr?}{ex}
	{ei}{sv11,GH ER _XC BC ci _}
	{sv29,{lbR}XC {if@not({er})}{glR}{ei}{pv11}NO }
	XP TF CG (es 1)
	BC ci \n\n\n \n\n{pv29}
	\n\n_[XXX][XXX]{pv11}
	\n\t_[XXX]\t{pv11}
	\nWN WN WN ._[XXX]WN WN WN .{pv11}
	\nWN WN ._[XXX]WN WN .{pv11}
	\nWN ._[XXX]WN .{pv11}
	\n_ _{pv11}
	[XXX]_\n{pv11}
	 _ _{pv29}
	CG (es)BC {prok}{ex}

The macro assumes that grafs are separated by
at least two newlines (if single newlines separate
grafs as well as lines, you end up with text
that's all one graf). The macro reduces multiple
newlines to two maximum, retains single newlines
that introduce numbered and tab'd lines, converts
all other newlines to spaces, and reduces multiple
spaces to single space (after testing to insure
that a file is open).

In xyWrite 3, to handle the wildcard number
search&replace you'd need to run the !xyWise runtime
string library to grab its proc {is28} (the current
version of the ci/cv wildcard_wildcard proc, rewritten
from scratch, is so reliable it's scary). The macro
needn't define procs {is29} and {is11}; the code
that precedes the first ci command does that and
loads ci/cv wildcard_wildcard proc {is28}:

	{if@siz({va$fp})<1}{pr?}{ex}
	{ei}XP TF {lb!lib}{pv29}{lbKeep@C}{pv28}
	!$.LIB {pv00}{sv11,0}{pv107}{pv21}es 1XC
	BC ci \n\n\n \n\n{pv29}
	\n\n_[XXX][XXX]{pv11}
	\n\t_[XXX]\t{pv11}
	{sv10,\nWN WN WN ._[XXX]WN WN WN .}{sv00,ci _}{pv28}
	{sv10,\nWN WN ._[XXX]WN WN .}{sv00,ci _}{pv28}
	{sv10,\nWN ._[XXX]WN .}{sv00,ci _}{pv28}
	BC es 1XC BC ci _\n_ _{pv11}[XXX]_\n{pv11}
	 _ _{pv29}
	BC esXC BC {prok}{ex}

Encoded below my sig is a pgm that combines both
macros; you can run !reduce in xyWin (so presumably
in xyDos4 as well) and--if !xyWise is installed--
in xyW3 (clear CMline, type !reduce, and tap
your  key). I resisted gilding the lily;
I assume that if you wanted to convert carriage
returns and linefeeds to newlines or needed
other services you'd have said so.

			*

Speaking of !xyWise (as I'm wont to do),
I completed a bigtime !xyWise/!xyWiz/!xyWWWiz
overhaul last month and invite xyW3 users who
haven't tried them or who have and have been
disappointed (or daunted by !xyWise setup)
to visit my www site (URL in my sig).

!xyWiz is a collection of xyW3 pgms that
make no attempt to be all things to all users:
the pgms are intentionally strictly limited
to xyW basics. E.g., my xpl offline email
manager, which includes routines similar
to those in !reduce, isn't in the package.
se/seb/ci/cv[a] options, otoh, are collected
in a modular pgm named !^v--after its original
module, first posted to this list five or six
years ago, which searches back if a forward
search fails. (Get it--search up ^, down v?)
"Circular" searches are old news to !xyWiz.

In short, !xyWiz modules amplify and streamline
familiar writing, editing, file management, and
Internet tasks, and introduce options XyQuest
didn't get to till v4 if ever.

!xyWWWiz is an html assistant that--also rewritten
from scratch--is now a !xyWiz component. The new
tagging module is at least the equal of any I've
tried.

Because the !xyWise overlay lets an xpl pgm
rebuild the entire prelaunch state, you'll see
!xyWiz and !xyWWWiz do things xyWrite 3 never
could before. Drain on permanent memory is minimal
(only 3.25k occupies Help frames, sparing you the
instability a proliferation of xpl Help frames
seems to introduce to the otherwise rock-steady
xyWrite 3). Documentation is copious, including
instructions on how to use !xyWise in your own pgms.

And, as ever, printer driver updates are a xyWrite 3
nonissue if you use hardware or software PostScript:
integration help available at the same URL. (Sprint
was a dos word processor Borland published for five
minutes, but it was good enough that it still has
adherents as faithful as xyWrite users; for some
reason, they seem much better informed than xylist
subscribers about PS benefits to legacy app users.
God knows, I've tried.)

If you use xyW3, I hope you'll take a look--or
a fresh look--at the site. ... Ciao. 		--a

======================================= adpFisher  nyc
	xyWrite 3 supplements !xyWise and !xyWiz +
	Wolfgang Bechstein's seafaring adventures:
http://www.escape.com/~yesss/ ========================================


MIME-Version: 1.0
Content-Type: application/octet-stream; name="!REDUCE"
Content-Transfer-Encoding: base64

rmlmQHNpeiiudmEkZnCvKTwxr65wcj+vrmV4rw0KrmVpr/+Brf+A8f+BH2VzIDH/gQn/gR+uc3gx
MyyudmEkdmWvr65zdjExLFY0Lq+uc3gxMyyuaXMxMa/urmlzMTOvr65pZq5wdjEzrz48MK+ucHYy
Oa+ucHYyOK8hJC5MSUIgrnB2MDCvrnN2MTEsMK+ucHYxMDevrnB2MjGvrmdsK6+uZWmvrnN2Mjks
rmxiUq//gQmuaWZAbm90KK5lcq8pr65nbFKvrmVpr65wdjExr/+Bo6+uc3YxMSz/gG3/gHlf/4EJ
/4EfY2kgX6+ubGIrr2NpICD/MEH/MEH/MEEg/zBB/zBBrnB2Mjmv/zBB/zBBXxUUFRUUFa5wdjEx
r/8wQQlfFRQVCa5wdjExr65pZq5wdjEzrz09MK+uTEJ2NK//MEH/gQH/gQH/gQEuXxUUFf+BAf+B
Af+BAS6ucHYxMa//MEH/gQ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