[Date Prev][Date Next][Subject Prev][Subject Next][
Date Index][
Subject Index]
Re: Corrected HBSA
- Subject: Re: Corrected HBSA
- From: Harry Binswanger hb@xxxxxxxx
- Date: Mon, 19 Oct 2009 09:18:30 -0700
No, > is wrong. You're backing up the file in the
current directory -- not necessarily the displayed file!
Oh, I think I see what you're saying: if FOO.BAR is in both C:\A and C:\B
it would back up the wrong FOO.BAR if I were looking at \A\FOO.BAR while
logged onto \B.
God, that's a great point, and what is SAved and backed up is so critical
to one's work that every possibility has to be covered. Great catch, Carl.
In partial reciprocation I've just made a discovery that could simplify
things. Maybe you already know this, but I found that when you have
[UNTITLED] onscreen, VA$FP gives no path, so for [UNTITLED] VA$FP = VA$FI.
I think this is the only case in which that's true. I tried doing the
duplicate opening of a file and got different (strange) values for $FP and $FI.
So this could provide an easy test of [UNTITLED]. Of course even easier
would be testing for $FI = [UNTITLED]. But there may be cases in which you
already have saved $FP and $FI, and could save a little memory by not
testing with "[UNTITLED]".
Separately, I note that you once again use a long IF . . . EI rather than
(as I did) disposing of the U2-save case right away, by IF [...U2...] JM
2.LH then doing the non-U2 stuff "free and clear." Since you do this
long-IF structure regularly, you must have a reason for preferring that.
Which would be . . . ?
Thanks,
Harry
At a
minimum, you should do something like this:
XPLeNCODE v2.0
b-gin [UNTITLED]
{{;5hbsa}} For ctrl-s: if file is the U2, will call LoadHelp{032}
[HB 11/03/08][cr|lf]{002}{<}IF{<}VA$FP{>}<>{<}VA$U2{>}{>}{<}S
X01,{<}VA$FP{>}{>}{<}SX02,{<}VA$FI{>}{>}{<}IF{<}IS01{>}<>("C:
\BAK\"+{<}IS02{>}){>}[BX_]copy/nv {<}PV01{>} C:\BAK\{<}PV02{>
}[Q2_]{<}EI{>}[BX_]sa[Q2_]{<}IF@not({<}ER{>}){>}{<}PRSaved an
d backed up{>}{<}EI{>}{<}EX{>}{<}EI{>}[JM_]2.LH[Q2_]{002}[cr|
lf][cr|lf]
-nd
XPLeNCODE
This doesn't take [UNTITLED] and other bracketed filenames into
account, but neither does your original.
--
Carl Distefano
cld@xxxxxxxx
Harry Binswanger
hb@xxxxxxxx