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

Re: Corrected HBSA--Corrected



Harry:

A few comments and suggestions:
- If I were you, I wouldn't cancel the SAve if the backup fails. I think writing the current version of the file is more important than preserving an earlier version of the file that you intend to overwrite anyway (or you wouldn't be running this PM in the first place). Don't you agree?
- The business of putting, then back-deleting, a carriage return is
overkill. As I explained last week, simply GTing an empty S/G to text
will set the $MO flag without modifying on-screen contents, even
fleetingly. Why do more than necessary?
- You don't need a "Done" PRompt if the SAve succeeds -- Editor does
that for you. What you do need is to capture and display any error
message generated by the SAve -- or, better still, any error message
generated by either the backup COPY or the SAve. That's critical
information that shouldn't be masked by a generic PRompt that merely
says, in effect, "Oops, it didn't work."

Here's a rewrite that implements the above:

XPLeNCODE v2.0
b-gin [UNTITLED]
{{;5hbsa}} For ctrl-s and ctrl-e: keep bk=0 but get same effe
ct; also if file is U2, calls LoadHelp [HB 10/21/09 rev. CLD{032}
10/22/09][cr|lf]{002}{<}SX01,{<}VA$FP{>}{>}{<}SX02,{<}VA$U2{>
}{>}{<}IF{<}IS01{>}<>{<}IS02{>}{>};*; regular, non-U2 case[cr
|lf]{<}SX02,{<}VA$FI{>}{>}{<}SV03,{>};*;[cr|lf][BX_]exist {<}
PV01{>}[Q2_]{<}IF@NOT({<}ER{>})&{<}IS01{>}<>("C:\BAK\"+{<}IS0
2{>}){>}[BX_]copy/nv {<}PV01{>} C:\BAK\{<}PV02{>}[Q2_]{<}IF{<
}ER{>}{>}{<}SX03,{<}VA$ER{>}{>}{<}SX03,{<}VA\@03{>}{>}{<}EI{>
}{<}EI{>};*; [cr|lf][GT_]{<}SV01,{>}{<}GT01{>};*; force disk-
write without (even temporarily) modifying file[cr|lf][BX_]sa
[Q2_]{<}IF{<}ER{>}{>}{<}SX01,{<}VA$ER{>}{>}{<}SX01,{<}VA\@01{
{062}}{>}{<}SX01,"SAve error: "+{<}IS01{>}{>}{<}EI{>}{<}IF{<}VA|0
3{>}>0{>}{<}SX01,{<}IS01{>}+" Backup error: "+{<}IS03{>}{>}{<
}EI{>}{<}IF{<}va|01{>}>0{>}{<}PR@01{>}{<}EI{>}{<}EX{>};*;[cr|
lf]{<}EI{>};*;[cr|lf][JM_]2.LH[Q2_]{<}EX{>}{002}[cr|lf][cr|lf
]
-nd
XPLeNCODE

--
Carl Distefano
cld@xxxxxxxx