[Date Prev][Date Next][Subject Prev][Subject Next][
Date Index][
Subject Index]
Re: SaveBak
- Subject: Re: SaveBak
- From: Carl Distefano cld@xxxxxxxx
- Date: Thu, 30 Dec 2010 14:29:22 -0500
Reply to note from Harry Binswanger Thu, 30 Dec
2010 10:15:28 -0500
Harry:
> I'm trying to assign SaveBak (or SAB) to ctrl-F5. ...
>
> I know S/G 50 is empty, but it's empty whether or not I execute
> from the CMline.
The problem, when launching SaveBak,SAB from the KBD file, is not
that S/G 50 is empty, it's that S/G 50 is uninitialized. That's why
")>" bombs; "" presumes and *requires* an
initialized S/G nn. There are two ways around this. The generic
solution is to construct the key assignment using frame PrsKbdArg,
which is designed to pass "framename args" to U2 via the KBD file,
but which also works with a framename _sans_ args, even if the
argument-handler S/G 50 is uninitialized (PrsKbdArg initializes it).
Used with framename SAB, the key assignment would look like this:
nn=NOJM(,2,.,P,r,s,K,b,d,A,r,g,),s,a,b,NO
Command HELP PRSKBDARG for further information on this
essential routine.
With particular reference to SaveBak,SAB, though, since the routine
accepts but does not require an arg, I think it's reasonable to
expect the routine itself to trap an uninitialized S/G 50. It's a
easy fix (the IF statement immediately following func XH in the
revised frame below). Plug it in, then you can use your existing KBD
assignment, or the more concise:
nn=NOJM(,2,.,s,a,b,)
XPLeNCODE v2.0
b-gin [UNTITLED]
{{;5SaveBak,Sab,CopyBak,EDC}} Incremental file-backup tool [C
LD rev.12/30/10][cr|lf]{002}[XH_]{<}IF{<}VA|50{>}<0{>}{<}SV50
,{>}{<}EI{>}{<}SX01,@upr({<}IS50{>}){>}{<}SV02,{>}{<}SX50,-99
{>}{<}IF@upr({<}VA$FR{>})=="COPYBAK"{>}[BX_]exist {<}PV01{>}[
Q2_]{<}IF{<}ER{>}{>}{<}SX50,-2{>}{<}EX{>}{<}EI{>}{<}SV02,!{>}
{<}EI{>}{<}IF{<}VA$WS{>}==1&{<}VA|02{>}<1{>}{<}IF{<}VA|01{>}>
0{>}{<}SX03,{<}VA$FI{>}{>}{<}GLc{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PV04{>}>999{>}{<}SV01,Can
't perform backup SAve - Maximum 999 backups per filename{>}{
<}
GLj{>}[cr|lf]{<}EI{>}{<}IF{<}PV04{>}=={<}PV07{>}{>}{<}SV08,1{
{062}}{<}SX07,{<}PV07{>}+27{>}{<}EI{>}{<}LBf{>}{<}SX04,{<}IS04{>}
{>}{<}IF{<}VA|04{>}<3{>}{<}SX04,"0"+{<}IS04{>}{>}{<}GLf{>}{<}
EI{>}[BX_]exist {<}PV03{>}.{<}PV04{>}[Q2_]{<}IF{<}ER{>}{>}{<}
GLg{>}{<}EI{>}{<}IF{<}IS08{>}=="1"{>}{<}SX04,{<}PV04{>}+26{>}
{<}EI{>}{<}GLe{>}{<}LBg{>}{<}IF{<}IS08{>}=="1"{>}{<}SX04,{<}P
V04{>}-27{>}{<}GLe{>}{<}EI{>};*;[cr|lf]{<}SV01,SAved to {>}{<
}SX03,{<}IS03{>}+"."+{<}IS04{>}{>}[DZ_][BX_]{<}IF{<}VA|02{>}>
0{>}copy/nv {<}LB <== 1 space here{>}{<}PV02{>}{<}GLh{>}{<}EI
{>}sa{<}IF{<}VA$DE{>}>0{>}d{<}SX01,"DeFine "+{<}IS01{>}{>}{<}
EI{>}{<}LBh{>} {<}LB <== 1 space here{>}{<}PV03{>}[Q2_]{<}IF{
<}ER{>}{>}{<}SX50,-3{>}{<}SX01,{<}VA$ER{>}{>}{<}SX01,"{<}VA\"
+{<}IS01{>}+"{>}"{>}{<}SX01,{<}PV01{>}{>}{<}GLj{>}{<}EI{>}{<}
SX01,{<}IS01{>}+{<}IS03{>}{>};*;[cr|lf]{<}IF@upr({<}VA$FR{>})
=="EDC"{>}[DX_]{<}SX01,{<}VA$FP{>}{>}{<}SX04,{<}VA$DT{>}{>}{<
}IF{<}VA$WS{>}>1{>}[LU_]{<}SX01,{<}VA$DR{>}{>}{<}SX04,{<}VADT
{>}{>}{<}EI{>}{<}IF{<}PV04{>}<1{>}{<}SX04,100{>}{<}EI{>}{<}SX
05,{<}CP{>}{>}{<}SV06, (original in adjacent screen){>}{<}IF{
<}VA$WA{>}<1{>}{<}SV07,ab/nv{>}{<}IF{<}VA$MO{>}>0{>}{<}PR\413
{>}{<}SX08,{<}RK{>}{>}{<}IF{<}VA$KC{>}<2{>}{<}SX50,1{>}{<}PRA
bort{>}{<}EX{>}{<}EI{>}{<}IF{<}VA$KC{>}<>21{>}{<}SV07,st{>}{<
}EI{>}{<}EI{>}[BX_]{<}PV07{>}[Q2_]{<}SV06,{>}{<}EI{>}[BX_]win
dow/nv n[Q2_][BX_]wait[Q2_];*;[cr|lf][BX_]ca/{<}PV04{>} {<}PV
03{>}[Q2_][BX_]wait[Q2_]{<}LBi{>}[BX_]jmp {<}PV05{>}[Q2_]{<}I
F{<}CP{>}<>{<}PV05{>}{>}{<}GLi{>}{<}EI{>}{<}SX01,"Editing a C
OPY of "+{<}IS01{>}+{<}IS06{>}{>}[DO_][FF_]{<}
EI{>}{<}SX50,0{>}{<}LBj{>}{<}PR@01{>}{<}EX{>}{002}[cr|lf][cr|
lf]
-nd
XPLeNCODE
--
Carl Distefano
cld@xxxxxxxx