[Date Prev][Date Next][Subject Prev][Subject Next][
Date Index][
Subject Index]
Re: Cursor Moves
Carl Distefano wrote:
> Not much programming, in fact. Using XPL v4 for the moment, it would
> come down to this ("" stands for a real carriage return):
>
> >BX (seb )NP ==>PP
Outstanding solution. Thanks!
I found two quirky bugs with this procedure (I'm using XyIII+ currently):
(1) if I am already at the top of the file, alt-up will put the cursor on
the second paragraph; this creates an oscillating cursor. (2) if the
paragraphs are separated by two carriage returns, and the cursor is
located on the second , the result of alt-up will be to put the
cursor on the *following* paragraph.
The following seems to do the trick (in XPL III+):
®SX01,®CP¯¯BC seb ||XC ®if®er¯¯TF ®gl2¯®ei¯NP ®if®CP¯>=®PV01¯¯PP
®ei¯®lb2¯
.................... ..
.....
The changes are under-dotted. The first change is to test for an error
after seb. If an error occurs, the cursor is already in the first
paragraph of the file. So I go ahead and TF, then escape the rest of the
program by using and . The second change is to change the
comparison between CP and PV01 from == to >= . The "greater than or equal
to" comparison covers situations where the resulting CP is greater than
the starting CP, such as when the starting CP was on the second in a
paragraph break.
My cursor is getting happier by the moment.
============================
Shawn Harrison
Associate Editor
Tyndale House Publishers
shawn_harrison@xxxxxxxx
============================
"The legal system is not fun, but it *is* an improvement
over duals and feuds." --Harvey Harrison, attorney