Re: Corrected HBSA--Corrected

  • From: Harry Binswanger <hb@xxxxxxxxxxxx>
  • To: xywrite@xxxxxxxxxxxxx
  • Date: Thu, 22 Oct 2009 12:59:09 -0400

Sorry, that's not my code that's encoded below. I must have pasted the wrong thing. I was wondering why Carl hadn't weighed in with his ever-valuable scrutiny.


Here's my code:

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][cr|lf]{0
02}{<}SX01,{<}VA$FP{>}{>}{<}SX02,{<}VA$U2{>}{>}{<}IF{<}IS01{>
}<>{<}IS02{>}{>};*; regular, non-U2 case[cr|lf]{<}SX02,{<}VA$
FI{>}{>};*;[cr|lf][BX_]exist {<}PV01{>}[Q2_]{<}IF@NOT({<}ER{>
})&{<}IS01{>}<>("C:\BAK\"+{<}IS02{>}){>}[BX_]copy/nv {<}PV01{
{062}} C:\BAK\{<}PV02{>}[Q2_]{<}EI{>};*;[cr|lf]{<}IF{<}ER{>}{>}{<
}PRCouldn't back up--save aborted{>}{<}EX{>}{<}EI{>};*; [cr|l
f][GT_][255+048+068][BD_];*; bug in Xy means this is needed t
o ensure it will be saved [cr|lf][BX_]sa[Q2_];*;[cr|lf]{<}IF@
NOT({<}ER{>}){>}{<}PR-Done-{>}{<}EX{>}{<}EI{>};*;[cr|lf]{<}PR
Backed up but NOT Saved{>}{<}EX{>};*;[cr|lf]{<}EI{>};*;[cr|lf
][JM_]2.LH[Q2_]{<}EX{>}{002}[cr|lf]
-nd
XPLeNCODE



1. I put in appropriate prompts.

2. I handled the hitherto neglected case of a first save of an onscreen file--i.e., no file by that name yet on the disk: I test with BX exist <VA$FP>Q2

3. I enabled the routine to handle STore as well as SAve (on the non-universally applicable assumption that uses ctrl-e for STore): If VA$KC = 18 ("e") then it ABorts the now saved file. I assume that STore is just a SAve followed by a closing of the file.

4. I added a work-around for the bug in Xy that results in some very minor changes not producing a SAve: I have the routine put in then immediately take out a <CR-LF>.

XPLeNCODE v2.0
b-gin [UNTITLED]
{{;5sa}} SAve current file and make backup copy in {<}VADR{>}
 [CLD][cr|lf]{002}{<}IF{<}VA$WS{>}==1{>}{<}SX01,0{>}[GT_]{<}S
V02,{>}{<}GT02{>}{<}SX02,{<}VA$FI{>}{>}{<}SV03,{>}{<}IF"["{23
8}{<}IS02{>}==0{>}{<}SX02,{<}VA@02[;2{>}{>}{<}SV03,!{>}{<}EI{
{062}}{<}IF{<}IS02{>}{240}"]"{>}{<}SX02,{<}VA@02]1{>}{>}{<}SV03,!
{>}{<}EI{>}{<}IF{<}IS02{>}=="UNTITLED"{>}{<}SX02,{<}VA$WN{>}{
{062}}{<}SX02,"UNTITLED."+{<}IS02{>}{>}{<}EI{>}{<}SX02,{<}VADR{>}
+{<}IS02{>}{>}{<}IF{<}VA|50{>}>0!{<}VA|03{>}<1{>}[BX_]sa{<}IF
{<}VA|50{>}>0{>} {<}PV50{>}{<}EI{>}[Q2_]{<}IF{<}ER{>}{>}{<}SX
01,{<}VA$ER{>}{>}{<}EI{>}[BX_]wt[Q2_]{<}EI{>}{<}SX03,{<}VABK{
{062}}{>}{<}IF{<}PV03{>}>0{>}[BX_]d bk=0[Q2_]{<}EI{>}{<}IF{<}IS02
{>}<>{<}VA$FP{>}{>}[BX_]sa/nv {<}PV02{>}[Q2_]{<}IF{<}ER{>}&{<
}PV01{>}<1{>}{<}SX01,{<}VA$ER{>}{>}{<}EI{>}[BX_]wt[Q2_]{<}EI{
{062}}{<}IF{<}PV03{>}>0{>}[BX_]d bk=1[Q2_]{<}EI{>}{<}IF{<}PV01{>}
{062}0{>}{<}PR\@01{>}{<}EX{>}{<}EI{>}{<}PRSaved{>}{<}EX{>}{<}EI{>
}{002}[cr|lf]
-nd
XPLeNCODE



Harry Binswanger
hb@xxxxxxxxxxxx


Other related posts: