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

Re: Strange SA/NV behavior--BK is culprit



Reply to note from Paul Lagasse  Sat, 17 Oct
2009 18:21:54 -0400

Paul:

> I agree that your current version of my routine works; I
> thought my second comment. further down in the email, where I
> also asked about how yr version would interact with a path that
> included a directory with an extension, made that clear

OK, so we agree: a forced SAve of a file can coexist with a backup
of the previous SAved version of the file. No surprise there, since
BK=1 works fine in Xy3+ and earlier versions of Editor, where the
SAve command does a disk write even if the file's contents haven't
changed.

Your comment about directories with an extension went right by me.
You're correct, of course: my code would bomb if any directory in
the filepath contained a dot. Here's a fix:

XPLeNCODE v2.0
b-gin [UNTITLED]
{<}IF{<}VA$MO{>}>0{>}{<}SX01,{<}VA$FP{>}{>}[BX_]exist {<}PV01
{>}[Q2_]{<}IF@NOT({<}ER{>}){>}{<}SX02,{<}IS01{>}{>}{<}IF{<}VA
$EX{>}>""{>}{<}SX03,{<}IS01{>}+"{014}"{>}{<}SX02,"."+{<}VA$EX
{>}+"{014}"{>}{<}XS03,02,02,04,04{>}{<}EI{>}[BX_]copy/nv {<}P
V01{>} {<}PV02{>}.BAK[Q2_]{<}EI{>}{<}EI{>}[GT_]{<}SV01,{>}{<}
GT01{>}[BX_]sa[Q2_]{<}IF@NOT({<}ER{>}){>}{<}PRFile saved{>}{<
}EI{>}{<}EX{>}[cr|lf][cr|lf]
-nd
XPLeNCODE

--
Carl Distefano
cld@xxxxxxxx