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

More faux





The following xy 3+ XPL, muli-cl.pm, is designed to run a generic
XPL (that is, without any user input) on any number of files in a
particular directory.

It has been processed by Carl's fauxcode.xpm, and the
reprocessing yielded 100 percent compatibility with the original
program (at least before I wrote the text description).

Anyway, this XPL was the direction I was working in when I
stopped programming, so in a sense it is unfinished. Nevertheless
such a program can be productive because it allows one to run a
program or programs of choice on any number of files. If you work
with books, it's quite handy.

I wrote my multis in two variants, one with user input and one
without. This is one of the latter. Since I write basically all
my XPL with 2-digit SGs, I wrote this with 3-digit ones to help
distinguish it from my standard XPL.

Again, my convention is that except for the ENTER of SV201,
everything has either 2 (or 3!) ENTERs, or none at all.

--------------------------------------------------------------

{LB-mult-cl.pm--to run multi-ln.pm--by Chet Gottfried, P.O. Box
476, Sayville, NY 11782}DX_{GL-var}

{LB-var}{SV201,
}{SV213,BD_}{SV255,}{SX266,0}{SX268,0}{SV299,[027]}{GL-basic}

Yes, the basic label below is old hat for the most part.

{LB-basic}{SX212,{VANW}}BC_default nw=0XC_BC_ES 1XC_BC_red
offXC_SI_{SU999,BC_default nw={PV212}XC_BC_ES 0XC_DO_}
{SX220,{VA$WS}}{IF{PV220}==1}{GL-window}{EI}{GL-target}

Just checking on window status below.

{LB-window}{SX222,{VA$WS}}SW_n{SX224,{VA$WS}}
{IF{PV222}=={PV224}}{GL-abort}{EI}{GL-target}

User feedback below.

{LB-target}DO_BC_Enter target \path\file:
{PRENTER when done; ESC quits}{GL-read}

At about this time, XyQuest had begun putting more reliance on a
menu system (which TTG has carried on), so although a help frame
would have been simpler I decided on feedback on the command
line. But the two factors to watch out for are function calls and
more deletes than added characters. I use the same "engine" of
the following three labels in a number of different programs.

{LB-read}{SX202,{RC}}{IF{IS202}=={IS299}}{Gl-abort1}
{EI}{IF{IS202}[238]{IS201}==0}{GL-exist}
{EI}{SX215,@SIZ({IS202})}{IF({PV215}>1)}{GL-test}{EI}{GL-cat}

{LB-test}{IF({IS202}<>{IS213})}{GL-read}{EI}
{SX266,{PV266}+1}{SX259,@SIZ({IS255})+3}
{IF(({PV259}-({PV266}*3))<{PV266})}{GL-abort2}{EI}{GL-cat}

{LB-cat}{PV202}{SX255,{IS255}+{IS202}}{GL-read}

{LB-exist}BC_DX_BC_exist {PV255}XC_{IF{ER}}{GL-abort3}
{EI}BC_ca {PV255}XC_{GL-program}

The XPL multi-ln.pm can be any "dumb" program you want; the main
significance of the assignment "multi" after the program name is
if the XPL to be called involved user feedback. You just have to
remember to end the secondary XPL(s) with EXs unless a fatal
error occurs.

{LB-program}{IF{PV268}<1}DO_BC_run MULTI-LN.pmXC_BC_
{PRworking . . .}DX_{GL-next}{EI}BC_run MULTI-LN.pm,multiXC_BC_
{PRworking . . .}DX_{GL-next}

{LB-next}BC_stXC_EN_{SX224,{VA$WS}}{IF{PV224}<>1}{GL-end}
{EI}{SX268,{PV268}+1}XP_TF_{GL-program}

{LB-end}{GT999}BC_Finished processing {PV255}{PRDone!}{EX}

{LB-abort}{GT999}BC_You need an empty window{PRAborted}{EX1}

{LB-abort1}{GT999}BC_{PRAborted via ESC}{EX1}

{LB-abort2}{GT999}BC_{PRAborted--too many deletes}{EX1}

{LB-abort3}{GT999}BC_Wrong directory or nonexistent files
{PRAborted}{EX1}

--------------------------------------------------------------
---
 ? SLMR 2.1a ? Art + write + dtp = chet.gottfried@xxxxxxxx