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

Making XyWrite even more convenient with $X



Carl's $X frame in XYWWWEB.U2, when assigned to the Enter key, permits you
to execute U2 frames by hitting Enter rather than using a special
"Helpkey." (At least that is how I use it.) I have modified it in a few
ways to make using Xy more convenient, and I recommend others try
implementing similar changes (I would send my XPL, but it's too
idiosyncratically customized).

With the modifications, I can also just hit Enter to:

--Run programs without prefixing them by "RUN " and without typing ".PGM"
  E.g., TEST{Enter} is executed as RUN TEST.PGM

--Open data files without using "CA " before their filenames
  E.g., FOO.BAR{Enter} is executed as CA FOO.BAR

--Open .PGM files without using "CA "
E.g, TEST.PGM{Enter} is executed as CA TEST.PGM (if I want to RUN the file, I omit the .PGM extension)
--Change directories without typing CD, no matter where they are in the
file structure
  E.g., DIR3{Enter} is executed as CD \DIR1\DIR2\DIR3
Note: to implement this, you need to hard-code the path to CD to in each case, using a bunch of IF-THENs. No big deal.
These little shortcuts enable you to work the way you think: by focusing on
the object of your action, rather than your action. For me, they enhance my
sense of efficacy in operating XyWrite. So you might try Carl's routine,
and modifying it to suit your purposes.
Here is the Carl's latest version (120), as encoded with XyEnc. Decode with
XyDec.

'%--_XYENCode_start--
'^{{5PrsLine$X}}_Execute_current_line_of_text_as_"command|fram
ename[_arg[,arg...]]"_via_frame_$X_[CLD_rev._1/25/14]'^~B~==1~>~~>'DP~'YD'JMjmp_~'Q2~==~-2~>~~~<
SX50,~~>~~>0~>'JM2.$X'Q2~~~<
PRPrsLine$X'._No_command~>~~~
~B'^'^{{5PrsDefine$X}}_Execute_DeFined_"command|framename[_arg
[,arg...]]"_via_frame_$X_[CLD]'^~B'DZ~>0~>~
'JM2.$X'Q2~~~~B'^'^{{5$X}}_Issue
_COMMAND[_arg(s)]_or_U2'-FRAMENAME[_arg(s)]_wi
th_one_key_[CLD_rev.1/24/09,_rev.11/21/13_(numeric_framenames)
]'^~B~<1~>~~>~>~~
~==28'|~==104~>~>0~>'JM2.null'Q2
~~>0&~<2~>:~M~~~~<1&~>0~>'JM2.$S'Q2~~<>0&~<
IS50~>=="?"'|~<>1&"HELP"~{@upr(~)<>0~>~~>~~>'BXd_wa=0'Q2~+"'Q2"~>~+"'Q2"~>~)==0'|"DEFAULT_EB"~{@upr(~)==0'|"D_$EB
"~{@upr(~)==0'|"DEFAULT_$EB"~{@upr(~)==0'|"VA/NV
_EB"~{@upr(~)==0'|"VA/NV_$EB"~{@upr(~)==0~>~~~)==0'|"DEFAULT_WA
"~{@upr(~)==0~>~~~>10~>'BXd_eb
=0,0'Q2~~)==0~>~~~~<1'|"BEEP"~{@upr(~)==0'|"RUN_"~{@
upr(~)==0'|@upr(~)=="RUN"~>~~'BXes
'Q2'BX~'Q2~~'BXes_1'Q2'BX'Q2'BXes'Q2~>1&~>0&"_"~{~<0&"|CALL|CD|CHDIR|DELETE|EDIT
|ERASE|ERNV|READ|RUN"~=("|"+@upr(~))~>~+"
_"+~~>~~~~&"="~{~<0~>~<>0~>~+""""~>~~~'BX~'Q2~)'|~<>12~>~~~~'BXwait'Q2
~~~~~<>""~>~~>~~~'BXes'Q2'JM2.PrsSG50'Q2~B'^
'%--_XYENCode___end--
and this has to be in your Xy4.DLG file, as the first active line after the ;DG; line:

'%--_XYENCode_start--
{{5$?}}_Redirect_source_for_funcs_$A-$Z|$0-$9_from_.DLG_to_.U2
_[CLD]'^~B~~>'JM2.~'Q2~B'^'^
'%--_XYENCode___end--

and for your .KBD file:

28=Q8$X  <=== Q8 is for the spellchecker's use of Enter
The essential modification I've made, is included below, just to give you the idea:
I'm using s/g 91 to store what was on the command line when Enter was hit.

'%--_XYENCode_start--
~<0&"_"~{~<0&","~{~<0~>'BXrun_~<
PV91~>.pgm'Q2~)~>~~~',*',_able_to_r
un_it_so_now_done'^'BXca_~'Q2~)~>~~<
EI~>',*',_'^
'%--_XYENCode___end--
In English: If what's on the command line contains no period and no space, then prefix it by "RUN " and postfix it by ".PGM" and execute it. Otherwise, try to open it, by prefixing it by "CA " and executing it.
The absence of a period differentiates running a .PGM file from opening it.
The absence of a space is for cases like "DIR *.TMP" and "SA FOO.BAR."
Somewhere else in the frame, I deal with the possibility of no spaces but
commas, to handle entries like TS,5,10,15

Enjoy.