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

Re: Automatic Saves when typing



Reply to note from Leslie Bialler  Wed, 05 Jan
2005 10:19:03 -0500

> I use the far-right page down key (obviously with number lock
> turned off) to both page down and save.

That's as good a choice as any, and better than most -- but read on.

Here's the ultimate key assignment for people worried about losing
work, allowing unlimited Backup|Undo|Pentimento|Obsession|Insanity
(Jumbo U2 must be installed):

First, DECODE the following frame USAVE (Unlimited SAVE), DeFine it
and issue ADD2U2:

XPLeNCODE v2.0
b-gin [UNTITLED]
{{;5usave}} Save current file with filename YYMMDDHH.MMx [CLD
][cr|lf]{002}{<}SV01,ON{>};*; <==Change ON to OFF to disable{032}
USAVE[cr|lf];*;      Issue LOADHELP to reLOAD U
2[cr|lf]{<}IF@upr({<}IS01{>}){240}"N"&{<}VA$WS{>}==1{>}[JM_]2
{046}autofile[Q2_];*;[cr|lf]{<}SV01,{>}{<}IF{<}VA$MG{>}>""{>}{<}S
X01,{<}VA$MG{>}{>}{<}EI{>}{<}PR@01{>}{<}EI{>}{002}[cr|lf]
-nd
XPLeNCODE

Next, in your keyboard file, append "JM2,.,u,s,a,v,e,Q2" to the key
assignment(s) of your choice. For example, Leslie's "gray" PgDn
assignment would look like this:

81=PDJM2,.,u,s,a,v,e,Q2

However, cursor keys such as PgDn are not the best choice for this
routine, because if you hit PgDn several times in quick succession,
you'll get multiple identical backups. I'd assign it to the
full-stop key (52) or, if you're really obsessional, to the comma
key (51). Note that a comma-key assignment requires special
treatment -- a func CO to put the comma:

51=COJM2,.,u,s,a,v,e,Q2

STore and reLOAD the KBD file.

Every time you hit the assigned key, the file is saved under a
unique, *new* filename in the form YYMMDDHH.MMx -- based, obviously,
on the current date and time (where "x" is an additional
alphanumeric character that enables up to 36 SAves per minute; if
you exceed 36, the routine waits until the stroke of the next minute
before SAving -- yes, it's nuts, but it works). These backup files
are collected in the directory of your choice; by default, it's the
directory that contains EDITOR.EXE; to change it, edit user variable
Autofile_Saved_Files in XYWWWEB.REG (if necessary, add it to REG),
for example:
Autofile_Saved_Files=d:\My\Crazy\Backup\Dir

The naming scheme makes the backup files easy to identify, sort,
manage -- and, especially, delete. For example, to delete all files
created today, issue at the DOS prompt: DEL 050105*.*. (True, the
backup names don't give any indication of the original filename, but
the original is readily identifiable by other indicia, such as the
date, time and size of the backup -- and, of course, simply by
CAlling the backup file.)

One last thing: you can suspend or disable this craziness by editing
frame USAVE. In eXPanded view, change Save/Get 01 to "OFF", thus:
. Issue LOADHELP to reLOAD U2 after editing.

A less obsessional approach, instead of assigning USAVE to a key,
would be to call it from within Ersatz Autosave. That way, the
backup SAves would occur at regulated intervals (as determined by
the Ersatz Autosave REG variable Autosave_Mins_Between_Saves).
First, of course, you have to install Ersatz Autosave (which is, as
I mentioned the other day, a .DLG-based routine), and edit it to
call USAVE instead of, or in addition to, performing the straight
SAve. If you're interested and need help, let me know.

By the way, here's how my backup directory looked after I assigned
USAVE to the comma key (backups generated by 10 minutes of writing):

05010515 00A    32685   1-05-2005  3:00pm
05010514 57A    31967   1-05-2005  2:57pm
05010514 57B    31978   1-05-2005  2:57pm
05010514 56A    31930   1-05-2005  2:56pm
05010514 52E    31853   1-05-2005  2:53pm
05010514 53A    31863   1-05-2005  2:53pm
05010514 53B    31882   1-05-2005  2:53pm
05010514 52A    31721   1-05-2005  2:52pm
05010514 52B    31732   1-05-2005  2:52pm
05010514 52C    31797   1-05-2005  2:52pm
05010514 52D    31837   1-05-2005  2:52pm
05010514 50A    31545   1-05-2005  2:50pm
05010514 50B    31582   1-05-2005  2:50pm
05010514 50C    31594   1-05-2005  2:50pm
05010514 50D    31641   1-05-2005  2:50pm

There you have it: automatic, no-thinking-required, obsessive-
compulsive, anal-retentive backup SAves.

Still worried?

--
Carl Distefano
cld@xxxxxxxx