[Date Prev][Date Next][Subject Prev][Subject Next][
Date Index][
Subject Index]
Re: Typing allergy
- Subject: Re: Typing allergy
- From: cld@xxxxxxxx (Carl Distefano)
- Date: Sat, 3 Jan 2004 16:24:21 -0500
Reply to note from Thu, 1 Jan 2004 10:23:03 +0100
John:
You've rediscovered the PV operator. To understand why your routine
works, read Robert Holmgren's CTRLCHAR.TXT. It was written with Xy3
in mind but applies to Xy4+, with a few differences. (The
DOCumentation for STACK.PM includes an update for Xy4+; see "Coffee
Break: One-Byte, Three-Byte, and Five-Byte Characters", in
STACK.DOC.)
> Briefly, one needs a saveget (@ or &, but loaded automatically
> by startup.int) containing code which:
>
> - copies the selected text into one of the savegets named 0-9
> (useable by means of a pv5, that is, not a pv05)
Why *not* PV05? In simplest form: BC . (For this
to work, a block of text or XPL code must be *fully* DeFined, i.e.,
the DF block must be "closed" with a second press of the DeFine
key.) Stricly speaking, a stay-resident Save/Get isn't necessary --
although it has to be a S/G that isn't used in the DeFined code,
otherwise the operation bombs. So, yes, it does make sense to
reserve a S/G in range 0-9|A-Z|100-999 for this purpose, but it
should be zeroed out at the end (e.g., ) to conserve memory.
But... rather than rely on a side effect of a routine to move
DeFined text to the CMline, you'd be better off using one designed
from the bottom up to run DeFined XPL code. U2 has such a routine,
RUNCODE, for Xy4+; see below for the equivalent for Xy3 v3.54+
(suitable for LDPMing). You'll need Xy4 and U2 to decode it
(DECODE); command HELP RUNCODE for instructions
(usage for the Xy3 version is identical). RUNCODE, by the way,
saves the DeFined code as SUbroutine 754 which it then launches with
.
RUNCODE is time- and torture-tested; it'll run virtually anything.
XPLeNCODE v2.0
b-gin [UNTITLED]
{<}GLa{>} RUNCODE3.PM - CLD 6/6/91 rev. 1/3/04 for XyIII+ v3.
54+[cr|lf]{<}LBa{>}{<}SX01,{<}VA$WS{>}{>}{<}IF{<}PV01{>}<1{>}
{<}PRFile or DIRectory required{>}{<}EX{>}{<}EI{>}{<}SX01,{<}
IS00{>}{>}{<}IF@siz({<}IS01{>})<1{>}{<}SU02,{<}SX01,{<}IS00{>
}{>}[NO_]{>}{<}GT02{>}{<}EI{>}{<}SX02,{<}VA$WS{>}{>}{<}IF{<}P
V02{>}>1{>}{<}SX02,{<}VA$DR{>}{>}{<}LBb{>}[BC_]run {<}PV02{>}
{<}PV01{>}[XC_][BC_][GT_]{<}EX{>}{<}EI{>}{<}SX02,{<}VA$DF{>}
{>}{<}IF{<}PV02{>}<1{>}{<}SX02,{<}VA$FP{>}{>}{<}GLb{>}[cr|lf]
{<}EI{>}[DX_][BC_]es 1[XC_][DF_][BC_]es[XC_][BC_][GT_][DO_][F
F_]{<}SV754{>}{<}SV02,{<}|{>}{>}{<}SV03,|{>}{<}XS02,03,04,05,
06{>}{<}SV02,SU754,{>}{<}SV03,SV00,{>}{<}SV05,{<}EX{>}[NO_]{>
}{<}SX02,{<}IS04{>}+{<}IS02{>}+{<}IS04{>}+{<}IS03{>}+{<}IS01{
>}+{<}IS06{>}+{<}IS754{>}+{<}IS05{>}+{<}IS06{>}+{<}IS05{>}{>}
{<}PV02{>}{<}GT754{>}{<}SV754,{>}{<}EX{>}[cr|lf][cr|lf]
-nd
XPLeNCODE
> Of course you can't create the digrams in a file which hasn't
> been opened with NEP or CAP....
Not true. The PFUN command (PFUN BC, for example) embeds "digrams"
-- better known as functions -- in any file. Works in Xy3+ too.
CAP and NEP are archaisms; there are better ways to record
keystrokes, even in Xy3. (Anyone have a copy of Robert's
NCAPTURE.PM? I don't anymore.) Xy4, of course, has built-in record
and playback facilites. There are U2 routines (RK, RKOK) that
harness these capabilities.
--
Carl Distefano
cld@xxxxxxxx
http://users.datarealm.com/xywwweb/