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

LH vs. SAve



If you ever make changes to U2, you know that you can't just hit ctrl-S to
SAve the results. You have to call LoadHelp (LH) to do that.
In the spirit of integrating U2 usage into normal Xy commands, I have a
real simple U2 frame that allows ctrl-s to work with U2 as with a normal
file. First you change your KBD file to make ctrl-s put out a call to the
new frame (which I named hbsa)

Table=Ctrl

31=nojm(,2,.,h,b,s,a,)
Then add the DECODED frame below to U2. It essentially tests for whether the file is XYWWWEB.U2, and if it is, then it calls LH for you.

XPLeNCODE v2.0
b-gin [UNTITLED]
{{;5hbsa}} For ctrl-s: if file is the U2, will call LoadHelp{032}
[HB 11/03/08][cr|lf]{002}{<}IF@Upr({<}VA$FI{>})=="XYWWWEB.U2"
{>}[JM_]2.LH[Q2_]{<}EX{>}{<}EI{>}[GT_][255+048+068][BD_][BX_]
sa[Q2_]{<}PRSaved{>}{002}[cr|lf]
-nd
XPLeNCODE
The part after the , which handles normal SAves, requires a little explanation. Why do I have the routine throw a carriage return - line feed into the text, then immediately wipe it out? This is necessary to make sure XyWrite registers that the file has been changed, so it will actually execute the SAve. This gets to one of the very, very few bugs in XyWrite: it doesn't register a change in capitalization as a change "worth" saving. Try this. Make a NEw file with this line:

I love XyWrite.

SAve it.
Then, without making any other changes to the file, put your cursor on the "I," go to the Command Line, execute command CC. That should change the "I" to lowercase. Go back to the Command Line and execute command SA. You should see the prompt "Proceed" rather than the familiar "Done"--that's a clue. If you now ABort the open file and open it again, the old, upper-case "I" will be there. The change to lowercase didn't get SAved.
But my addition to the ctrl-s command means anytime you hit ctrl-s, an
actual save will be done.


Harry Binswanger
hb@xxxxxxxx