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

Re: XPL best practices



Carl,
Interesting code. I spent an hour or so with it, looking up various things. One thing I wandered into was the U2 routine XSE, on which there's no help in the .inf file. Wazzat?

Also, on my system, the elapsed time was 0.

Regards,
Harry
Reply to note from "Patricia M. Godfrey"  Sat, 11
Nov 2006 15:40:36 -0500

Patricia:

Both versions run quickly here (after correcting several coding and/or
encoding errors, mostly extraneous or omitted spaces). But neither
version is optimal. It isn't necessary to open a document window in
XyWrite, either to substitute paths and filenames for replaceable params
%1, etc., or to write the BATch file to disk. Both can be done in
memory, using S/Gs.

Here's a variant of your Version 2 that shows how, introducing, in the
process, several additional economies. I haven't bothered to comment
the code; if you have questions, please ask. The heart of the matter is
to concatenate the runtime contents of the BATch file into a S/G (here,
S/G 01), then write it to disk with BX sa %01,d:\path\filename.batQ2 .
Note that SA %nn,d:\path\filename automatically overwrites any existing
file with that name, saving you the trouble of testing for existence and
ERNVing it in advance. Also, there is no need to tinker with default
EP; I deleted that bit.

XPLeNCODE v2.0
b-gin [UNTITLED]
{<}LBVersion2a{>}[ZT_]{<}SX50,{<}VA$FP{>}{>}{<}SX01,{<}IS50{>
}{>}{<}SV51,.{>}[JM_]2.XSR[Q2_]{<}SX02,{<}IS52{>}+".wp"{>}{<}
SX03,{<}VAWW{>}{>}{<}EI{>};*;[cr|lf];*;[cr|lf]{<}SX01,"@echo{032}
off[cr|lf]"+{<}IS03{>}+"W4W17F.EXE "+{<}IS01{>}+" /N /V2[cr|l
f]DELAY.EXE 2 >nul[cr|lf]if exist "+{<}IS02{>}+" del "+{<}IS0
2{>}+"[cr|lf]"+{<}IS03{>}+"W4W48T.EXE "+{<}IS02{>}+"[cr|lf]"{
{062}}[BX_]sa %01,{<}PV03{>}xytowp.bat[Q2_][BX_]wait[Q2_];*;[cr|l
f];*;[cr|lf];*; [BX_]dos/nv/z /c {<}PV03{>}xytowp.bat[Q2_];*;
 <== un-comment to run BAT file[cr|lf]{<}SX10,{<}VA$ET{>}{>}{
<}PR@10{>}{<}EX{>}[cr|lf][cr|lf]
-nd
XPLeNCODE

Hope this helps.

--
Carl Distefano
cld@xxxxxxxx


Harry Binswanger
hb@xxxxxxxx