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

Re: Use ENTER instead of helpkey



Reply to note from Harry Binswanger  Sun, 27 Sep
2009 13:15:54 -0400

> A year ago, Carl developed a frame, $X, that allows activating
> U2 frames with the Enter key, rather than needing a separate,
> assigned . I modified tinkered with, and customized
> Carl's code. In accordance with HBPPP (Holmgren Best Practices
> Programming Protocol) I left Carl's frame ($X) alone and named
> my version $H. (Note there is already a frame named $H, so make
> needed adjustments
> ...
> I'm including both Carl's original and my tinkered-with
> version.

Ahem, that is NOT my original! You've renamed it from $X to
"$X-10/10/08", with the result that it will NOT work for anyone who
follows my instructions. For this to work as advertised, the
framename has GOT to be $X.

In any event, I've made some tweaks to $X since posting the last
public version. Here is the current code (dated 1/24/09), and the
help screen (for XYWWWEB.INF).

I have some further comments in reply to you, which I'll post in a
separate message.

Code (for U2 file):

XPLeNCODE v2.0
b-gin [UNTITLED]
{{;5$X}} Issue COMMAND[ arg(s)] or U2_FRAMENAME[ arg(s
)] with the same key [CLD rev.1/24/09][cr|lf]{002}{<
}IF{<}VA|50{>}<1{>}{<}SU01,{<}SX50,{<}IS00{>}{>}{>}{<}GT01{>}
{<}EI{>}{<}IF{<}VA$KC{>}==28!{<}VA$KC{>}==104{>}{<}IF{<}VA$SM
{>}>0{>}[JM_]2.null[Q2_]{<}EI{>}{<}IF{<}VA$TX{>}>0&{<}VA$WS{>
}<2{>}[255+048+068]{<}EX{>}{<}EI{>}{<}EI{>}{<}IF{<}VA!620{>}<
1&{<}VA|50{>}>0{>}[JM_]2.$S[Q2_]{<}EI{>}{<}IF""{238}{<}IS50{>
}<>0&{<}IS50{>}=="?"!{<}VA|50{>}<>1&"HELP"{238}@upr({<}IS50{>
})<>0{>}{<}SX01,{<}VA$EB{>}{>}{<}SX02,{<}VAWA{>}{>}[BX_]d wa=
0[Q2_]{<}SX01,"[BX_]es 1[Q2_][BX_]d eb="+{<}IS01{>}+"[Q2_]"{>
}{<}SX02,"[BX_]d wa="+{<}IS02{>}+"[Q2_]"{>}{<}IF"D EB"{238}@u
pr({<}IS50{>})==0!"DEFAULT EB"{238}@upr({<}IS50{>})==0!"D $EB
"{238}@upr({<}IS50{>})==0!"DEFAULT $EB"{238}@upr({<}IS50{>})=
=0!"VA/NV EB"{238}@upr({<}IS50{>})==0!"VA/NV $EB"{238}@upr({<
}IS50{>})==0{>}{<}SV01,[BX_]es 1[Q2_]{>}{<}EI{>}{<}IF"D WA"{2
38}@upr({<}IS50{>})==0!"DEFAULT WA"{238}@upr({<}IS50{>})==0{>
}{<}SV02,{>}{<}EI{>}{<}IF{<}VA|01{>}>10{>}[BX_]d eb=0,0[Q2_]{
<}EI{>}{<}IF"VA/NV WA"{238}@upr({<}IS50{>})==0{>}{<}PV02{>}{<
}SV02,{>}{<}EI{>}{<}IF{<}VA|50{>}<1!"BEEP"{238}@upr({<}IS50{>
})==0!"RUN "{238}@upr({<}IS50{>})==0!@upr({<}IS50{>})=="RUN"{
{062}}{<}PV01{>}{<}PV02{>}[BX_]es[Q2_][BX_]{<}PV50{>}[Q2_]{<}EX{>
}{<}EI{>}[BX_]es 1[Q2_][BX_][Q2_][BX_]es[Q2_]{<}IF{<}VA$WS{>}
{062}1&{<}VA$TX{>}>0&" "{238}{<}IS50{>}<0&"|CALL|CD|CHDIR|DELETE|
EDIT|ERASE|ERNV|READ|RUN"{240}("|"+@upr({<}IS50{>})){>}{<}SX5
0,{<}IS50{>}+" "+{<}VA$DR{>}{>}{<}EI{>}[BX_]{<}PV50{>}[Q2_]{<
}IF@not({<}ER{>})!{<}VA$ER{>}<>12{>}{<}PV01{>}{<}PV02{>}{<}EX
{>}{<}EI{>}[BX_]wait[Q2_]{<}PV01{>}{<}PV02{>}{<}EI{>}{<}SV01,
{>}{<}IF{<}VA$MG{>}<>""{>}{<}SX01,{<}VA$MG{>}{>}{<}
EI{>}{<}PR@01{>}[BX_]es[Q2_][JM_]2.PrsSG50[Q2_]{002}[cr|lf][c
r|lf]
-nd
XPLeNCODE

XPLeNCODE v2.0
b-gin [UNTITLED]
{$Xkey,$X}[cr|lf][cr|lf]Enhanced Func XC (eXeCute command) Su
bstitute[cr|lf]C.L.Distefano rev.1/24/09[cr|lf][cr|lf]Purpose
[cr|lf]-------[cr|lf]Use a single key of your choosing (refer
red to below as "<$Xkey>") to launch both built-in (native) c
ommands and user-created commands (U2 framenames) from the CM
line.[cr|lf][cr|lf]Critical Prerequisite[cr|lf]--------------
-------[cr|lf]The DiaLoG help file {<}VA$DG{>}) MUST contain{032}
the redirection frame {{;5$?}}. If it does not, add it by doi
ng the following: Toggle this file into eXPanded view (FUNC X
P). DeFine the following block of code (everything bet
ween the horizontal lines, not the lines themselves), and iss
ue ADD2DG.[cr|lf][cr|lf]- - - - -[cr|lf]{{;5$?}} Red
irect source for funcs $A-$Z|$0-$9 from .DLG to .U2 [CLD][cr|
lf]{002}{<}SX00,{<}VA$FR{>}{>}[JM_]2.{<}PV00{>}[Q2_]{002}[cr|
lf][cr|lf]- - - - -[cr|lf][cr|lf]Setup[cr|lf]-----[cr|lf]Assi
gn $X to the desired key in the KBD file:[cr|lf]nn=$X[cr|lf][
cr|lf]Note: $X is a complete substitute for both func XC and{032}
the Enter key ("[255+048+068]").[cr|lf][cr|lf]When assigning{032}
$X to the Enter key, insert an initial func Q8:[cr|lf]28=Q8$X
[cr|lf];;28=[255+048+068][cr|lf]or[cr|lf]104=Q8$X[cr|lf];;104
=[255+048+068][cr|lf][cr|lf](Func Q8 allows the modified Ente
r key to work with the spell-checker and the Help/Menu system
{046})[cr|lf][cr|lf]SAve and re-LOAD the KBD file after editing.[
cr|lf][cr|lf]Use[cr|lf]---[cr|lf]To launch a native command o
r U2 framename (referred to here interchangeably as "commands
"), type the command and arguments, if any, on the CMline, th
en hit <$Xkey> to execute.[cr|lf][cr|lf]Examples:[cr|lf]LM 1.
5IN<$Xkey> issues the native Left Margin command[cr|lf]TABLE{032}
VA<$Xkey> issues the U2 framename to display a list of XyWrit
e VAriables[cr|lf][cr|lf]Rules[cr|lf]-----[cr|lf]- Native com
mands take precedence over U2 framenames: If the command on t
he CMline is both a valid native command and a valid U2 frame
name, it is{032}
eXeCuted as a native command, NOT as a framename. To force ex
ecution as a framename, enclose the command (not the argument
s) in double quotes:[cr|lf] "command"[ arg(s)]<$Xkey>[cr|lf]
[cr|lf]Example:[cr|lf]You have a U2 routine called SAVE that{032}
SAves the current file to three different locations. If you i
ssue SAVE<$Xkey>, you get a normal, native SAve command. To i
nvoke your enhanced SAVE routine, issue:[cr|lf]"SAVE" d:\path
\myfile<$Xkey>[cr|lf][cr|lf]Exceptions:[cr|lf]1) When issued{032}
as a U2 framename, HELP [framename] displays the U2 Help scre
en for the specified framename. Frame $X treats HELP as a U2{032}
framename, even though HELP is also a native command. This sa
ves the trouble of typing U2 HELP framename<$Xkey> every time
{046} (The native HELP command, which displays the XyWrite splash
 screen, is accessible with ?<$Xkey>.)[cr|lf]2) Commands cons
isting of a single character (except "?") are issued as U2 fr
amenames.[cr|lf][cr|lf]- If $X is assigned to the Enter key (
key # 28 or 104), normal Enter key behavior obtains: If curso
r is on CMline, command is executed; if cursor is in the text
 area, a carriage-return is put at the cursor position.[cr|lf
][cr|lf]- If (and only if) {<}MDSO{>}{<}LBLink{<}SV50,Stack{>
}[JM_]2.help[Q2_]{>}STACK.PM{<}MDNM{>} is in use, commands is
sued with <$Xkey> are added to the Stack (command history). D
o NOT use "$S" in the KBD-file assignment; $X calls Stack int
ernally.[cr|lf][cr|lf]{<}FC{>}Renumber frame $X in PACK mode[
cr|lf]Default Save/Get Range=01-03; 620[cr|lf]OPTIONs(1): FRE
EZE 620[cr|lf]{<}FL{>}[cr|lf]-{tab}-{tab}-{tab}-{tab}-{tab}-{
tab}-{tab}-{tab}-{tab}-[cr|lf][cr|lf]
-nd
XPLeNCODE

--
Carl Distefano
cld@xxxxxxxx