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

XPL PSEUDO-CODE





 -> Carl Distefano:
XY-> Building on suggestions from T. Baehr, C. Gottfried and others
 -> regarding an XPL "pseudo-code" utility, I composed something called
 -> XPL2TXT.PM, which I've uploaded to the TTG BBS (as an attachment to
 -> public message #10620). (To post it here as pseudo-code would be
 -> tricky -- sorry!) Comments welcome.

What a neat little XPL, Carl!!! Works well too. Following is a
test XPL, encoded by Carl's program, for "smart" quotes
(revised). When I do use Xywin, I generally paste bits of text
into Quark or whatever, since Xy's autocorrect is very convenient
but it's a drag to transfer nontypographic characters via the
clipboard. Also, I like the way typographic marks look whenever
I'm working in a graphic view.

One of the very best features in any XPL is to be able to adapt
it for personal use. Carl's XPL meets that mark because although
it didn't control for the typographic marks, it was a simple
matter to add them to his convenient list. I also added (to his
list) the tab character as [tab] because, if memory serves, tabs
don't show up on "list" mail.

---------------------------------------------------

{LB-r-quote to enable "smart quotes," by Chet}XD {GL-var}

This version is a little more sophisticated than the first,
inasmuch as it controls for the first character, inserts a
nontypographic quote if on the command line, and DIES (as well as
making other headaches) if you use it in the DLG-menu system.
There's probably a good test if one's in the DLG.
Carl?

The variables below include a space (perhaps add a "hard" space
too?), a tab, and an ENTER. Note one can also have a
"smart" apostrophe XPL if you use 266 and 267 instead of the
double quote numbers below.

{LB-var}{SV33, [tab]
}{SV68,[264]}{SV70,[265]}{GL-position}

Below checks the cursor position.

{LB-position}{SX44,{VA$TX}}{IF{PV44}==1}{GL-begin}{EI}"{EX}

I use this XPL in graphic view, so the cursor movement test below
(55 and 56) is kind of primitive, but it seems to work.

{LB-begin}DF {SX55,{CP}}CL {SX56,{CP}}{IF({PV55}=={PV56})}
ES {PV68}{EX}{EI}DZ {SV22}XD CR {GL-check}

The end test is that if the preceding character isn't some kind
of space, a close quote is thrown in. It isn't totally accurate,
but it's at least as accurate as other WPs "smart quote" setups.

{LB-check}{IF({IS22}[238]{IS33}=>0)}{PV68}{EX}{EI}{PV70}{EX}

the end
---
 ? SLMR 2.1a ? Art + write + dtp = chet.gottfried@xxxxxxxx