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

Re: LH vs. SAve



> you can't just hit ctrl-S

And what, pray, is Ctrl-S? Why refer to keystroke instead of
assignment?

But Carl is right: poking a character, then deleting it, is
intrusive and unnecessary. Personally, I would modify Carl's
routine to run LOADHELP if current file is *either* VA$U2 or
"Edit_Copy_of_U2_File" -- instead of checking whether REG
Variable "Edit_Copy_of_U2_File" is empty or not.

And instead of native SA/NV, I do a lot of additional
"thinking". Here's the routine I call (modified since the last
version of U2 was issued) -- with explanations below:

nn=NOJM2,.,s,a,v,e,2,6,Q2

XPLeNCODE v2.0
b-gin [UNTITLED]
{{;5save26}} SAve with optional ZAP26 (if "z" on CMline), opt
ional multi-session SAves if DUO is active RJH LastRev.1/2/0
8[cr|lf]{002}{<}IF{<}VA$FI{>}{240}"["{>}[JM_]2.af[Q2_]{<}EI{>
}{<}SU01,{<}SX05,@UPR({<}IS00{>}){>}{>}{<}GT01{>}{<}SX07,{<}V
A$MO{>}{>}[BX_]es 1[Q2_][BX_][Q2_][BX_]sa/nv[Q2_]{<}IF{<}VA$E
R{>}==11{>}{<}IF{<}PV07{>}>0{>}[BX_]wait[Q2_]{<}PRSaved{>}{<}
LBA{>}[BX_]p[Q2_]{<}IF{<}IS05{>}=="Z"{>}[JM_]2.zap26[Q2_][BX_
]p[Q2_]{<}EI{>}[BX_]es[Q2_]{<}IF{<}VA$WS{>}==1&{<}PV07{>}>0{>
}[JM_]2.duo/r[Q2_]{<}EI{>}{<}PR {>}{<}EX{>}{<}EI{>}{<}PRProce
ed{>}{<}GLA{>}{<}EI{>}{<}SX01,{<}VA$ER{>}{>}{<}SX01,"{<}PR\"+
{<}IS01{>}+"{>}"{>}{<}PV01{>}{002}[cr|lf][cr|lf]
-nd
XPLeNCODE

What does it do?

1) If the window is "[UNTITLED]", the file is saved with a
unique "date-stamp" filename (using frame AUTOFILE or AF).

2) The CMline is captured in S/G 05 -- does CMline = "z" or
"Z"? -- for use in 7) below.

3) Whether the file has been MOdified or not is captured in
S/G 07 -- I don't waste time forcing a SAve on files that
haven't been modified -- if I need to do that (because
XyWrite hasn't modified it, but some external operation
has, and I want to revert), I just use U2 frame SANV directly.

4) I set the internal last-ERror number to 11.

5) SAve without verification.

6) If NO CHANGE to the ERror value:

  7) If "Z|z" appears on CMline, I remove the terminal EOF
  (old DOS Control-Z or ^Z, Ascii-26) character from the file
  (using frame ZAP26).

  8) If additional XyWrite sessions are running, I
  synchronize any occurrence of the same file in other
  session window(s) and force them to update as well
  (frame DUO).

       **OR**

6) If CHANGE to the ERror value, i.e. an error while saving:

  7) Report the error and abort.

-----------------------------
Robert Holmgren
holmgren@xxxxxxxx
-----------------------------