[Date Prev][Date Next][Subject Prev][Subject Next][
Date Index][
Subject Index]
Re: Program with callnext
- Subject: Re: Program with callnext
- From: "Robert Holmgren" holmgren@xxxxxxxx
- Date: Mon, 20 Dec 2004 16:07:20 -0500
** Reply to message from "morris krok" on Mon, 20 Dec
2004 11:03:37 +0200
> The attached program, execom.pm is useful with Robert's Callnext U2 found in
> XYwwweb.u2. I am interested to know whether it can be improved or written
> better. It either stores a program that has been called up with callnext, then
> edited if necessary and then stored in its original name, or stored with a bat
> extension.
Morris, as-is your program wouldn't work. Among other things, you can't run a
U2 frame with BC ... XC ! If you had tried it, you'd know it didn't work --
which would have been worthwhile to say. Moreover, it is just a *fragment* of
the process, not instructive to others (and therefore not suitable for posting
here). It presupposes that you have already issued a CAll instruction with
wildcards. It presupposes that window #1 is free (*very* unlikely). It
hardcodes paths instead of making them generic. And it doesn't actually *do*
anything worth automating -- everything you do in this program can be done
manually with +|- the same effort.
This is completely rewritten. I haven't tried it either, but it should work.
Changed:
renumber as contiguous block of Save/Gets
eliminate unnecessary/unused LaBels
test for window availability
insist that user enter valid response at initial PRompt
eliminate repetitive code
eliminate GoLabel forward references (XPL is interpreted language; references
should always be to already-digested code, i.e. backward -- runs much faster)
assume input is correct rather than faulty, so push error processing to end of
program
eliminate "keystroke macro"-type code, e.g. a lot of BD BackDeletes -- i.e. use
the XPL _language_ instead of just recording keypresses
do everything more concisely
XPLeNCODE v2.0
b-gin [UNTITLED]
;*; to be used on any file that has to be edited using the ca
llnext routine.[cr|lf];*;[cr|lf]{<}IF{<}VA$WA{>}>0{>}{<}LBA{>
}{<}PR/Yabort/Lstore/Gsave/{>}{<}SX05,@UPR({<}RK{>}){238}"YLG
"{>}{<}IF{<}PV05{>}>-1{>}{<}SU06,{>}{<}IF{<}PV05{>}<1{>}{<}SV
07,Aborted{>}{<}LBB{>}{<}SX08,{<}VA$WA{>}{>}[BX_]window #{<}P
V08{>}[Q2_][JM_]2.cn[Q2_]{<}GT06{>}[GT_]{<}PR@07{>}{<}EX{>}{<
}EI{>};*;[cr|lf]{<}SV07,End{>}{<}IF{<}PV05{>}<2{>}[BX_]st[Q2_
][BX_]wait[Q2_]{<}GLB{>}{<}EI{>};*;[cr|lf]{<}SX06,{<}VA$FP{>}
{>}{<}SX06,{<}VA@06.1{>}{>}[BX_]st/nv {<}PV06{>}.BAT[Q2_][BX_
]wait[Q2_]{<}SU06,[BX_]dir c:\water[Q2_]{>}{<}GLB{>}{<}EI{>};
*;[cr|lf]{<}GLA{>}{<}EI{>}{<}PRNo window{>}{<}EX{>};*;[cr|lf]
[cr|lf][cr|lf]
-nd
XPLeNCODE
-----------------------------
Robert Holmgren
holmgren@xxxxxxxx
-----------------------------