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

Re: Line endings



** Reply to message from Paul Williams:

There are lots of approaches to regularizing lone 10s and lone 13s,
i.e. turning them into 13/10s (CR/LF pairs). There are a couple of
wildcards that will do it -- I assume you're using Xy4+? They're all
derivatives of func NN -- I'm away from XyWrite, so don't hold me to
this, but I think a lone CarriageReturn is func NN followed
immediately by a 11h, Ascii-17; a lone LineFeed is func NN followed by
a down arrow, 19h --which is what? [converts hex to dec on his
fingers...] Ascii-25?

Now, there's a wierd wrinkle here, which is that I think the default
for a discretionary hyphen is Ascii-17 (anyway it's MY default,
whether or not it's the factory default) and consequently I think I
have to use a three-byte 17 in the KBD file -- or maybe it's the other
way around -- hey I shouldn't even be answering this without looking
first at XyWrite...

Anyway, you want to write XPL using these wildcards, and you're
having trouble getting any form of Ascii-10 to work in a command,
which implies to me that you're trying to put it on the CMline.
That's the wrong approach. Use func BX...Q2. Like this: (find a lone
LineFeed)

BX se |NN {25}|Q2
 or, to CHange them
BX ci |NN {25}||Q2

The real easy way to do this is to use frame T1310 in U2, it just
converts it automatically for you and tells you (in English!) what it
found, e.g. "nine hundred forty three Line Feeds and eight Carriage
Returns". Call T1310 as a subroutine from your program, i.e. position
the cursor where you want it (because T1310 operates from current
curpos to EOF) e.g. at TOF, then command
JM 2.t1310Q2
Actually, just look at T1310 and you'll see a template for doing
this. Right next to it you'll see some routines that perform narrower
tasks, like converting CRLF to lone 10 or lone 13, etc etc

I'm familiar with this because I fixed a bug in T1310 a few days ago
-- actually the bug is in XyWrite's ChangeInvisible routine, which
prevents a terminal Ascii-10 in a file from being CHanged. The new
T1310 fixes it, and will be in the next version of U2. But it's small
potatoes as improvements go; the present T1310 works very well.

******************
Robert Holmgren
holmgren@xxxxxxxx
******************