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

variant



Two notes re Carl's method of letting the ENTER key function
as the  that executes U2 routines.

1. Carl's method works (natch). I have some difficulties when running an XPL program and getting user-input via . In these cases, the ENTER key is supposed to terminate the user's input and exit the loop. But the old "in" (ascii 238) test for ENTER no longer works.

Here's a test program that doesn't work with the revised ENTER key but does with regular ENTER:

XPLeNCODE v2.0
b-gin [UNTITLED]
{<}SV58,[cr|lf]{>};*;[cr|lf]{<}LBA{>};*; LOOP [cr|lf]{<}SX01,
{<}RC{>}{>}{<}SV56,x{>}{<}IF{<}IS01{>}{238}{<}IS58{>}>-1!{<}I
S01{>}=={<}IS56{>}{>}{<}GLB{>}{<}EI{>};*;[cr|lf]{<}PV01{>}{<}
GLA{>};*;[cr|lf]{<}LBB{>};*; OUTLOOP [cr|lf][BC_]all done;*;[
cr|lf]{<}EX{>}[cr|lf]
-nd
XPLeNCODE


2. Carl's implementation requires one to precede the name of the desired U2 routine by a period. After using it, I found that I often didn't remember about the period until after I'd typed the framename.  I decided I wanted a different way to trigger ENTER as . I decided on period as the end of a framename {plus optional argument} entry. It's more natural to type, e.g., rather than

.help help

I wanted to be able to type the more natural:

help help.

So I modified PrsExe50 and PrsSG50 in U2 to allow the period to be at the end. (BTW,I did this after I already had the problems with testing for ENTER, so I don't think it's involved.) I accept the risk of someday intending to execute a regular command ending in a period that will not go through because of my change.

Here's the modification:

XPLeNCODE v2.0
b-gin [UNTITLED]
{{;5PrsExe50}} Execute S/G 50 as command+args or U2 .framenam
e+args [CLD][cr|lf]{002}{<}IF"."{238}{<}IS50{>}==0{>}{<}SV51,
{046}{>}{<}XS50,51,51,,52{>}{<}SX50,{<}IS52{>}{>}[JM_]2.PrsSG50[Q
2_]{<}EX{>}{<}EI{>}[BX_]{<}PV50{>}[Q2_]{002}[cr|lf][cr|lf]{{;
5PrsExeCM}} Execute CMline as command or U2 .framename [CLD r
ev. 5/20/03][cr|lf]{002};*; Replacement for func XC: 67=NOXH[
$S]JM(,2,.,P,r,s,E,x,e,C,M,)[cr|lf]{<}IF"."{238}{<}VA$CL{>}<>
0{>}[XC_]{<}EX{>}{<}EI{>}{<}SX51,{<}VA$CL{>}{>}{<}SV52,.{>}{<
}XS51,52,52,,50{>}[JM_]2.PrsSG50[Q2_]{002}[cr|lf]
-nd
XPLeNCODE

(Don't overlook the subtle change in the last XS; 52 for the "tail" is a dummy variable.)

Hmmm. Wouldn't it be possible to do the ultimate fix here? What if U2 gets triggered if and only if there's no regular Xy command found for the string entered? Something along the lines of:

IF VA$ER = 12 then ...

Of course you'd have to have the routine first generate a non-12 error to re-set the error flag.

This change, if it is feasible, would have a climactic effect:  virtually merging U2 with the factory code. No longer would a user have to remember (or even know) if a given command was built-in or U2-ed in by Carl and Robert.


Harry Binswanger
hb@xxxxxxxx