SET AUTOSAVE Command

If you do not want to bother entering SAVE periodically, you can use the SET AUTOSAVE command. You need to enter it only once during an editing session. This command issues a SAVE command automatically, each time you have typed in or changed a certain number of lines. You decide what the number should be.

If you want the file saved every time you change ten lines, your command would be:
====> set autosave 10

The SET AUTOSAVE command can be entered at any time during an editing session. However, it is best to enter it at the beginning of an editing session, right after the XEDIT command.

If you entered a SET AUTOSAVE command and the system goes down, your file would not be saved under its own file identifier. It will have a new file identifier. Every time the automatic save occurs, you will see the message
AUTOSAVED as nnnnnn AUTOSAVE A1

The part of the message that reads nnnnnn AUTOSAVE A1 is the new identifier. The file name will be a number (like 100001) and the file type will be AUTOSAVE. You would now have two files, one with the original identifier, and one with the AUTOSAVE identifier. However, the AUTOSAVE file is the more current one, so you want to replace the old file with it. Here is how.

Suppose you were editing the file RADIO WAVES, and the system went down. When the system is available again, your FILELIST display might look like this:
 yourid   FILELIST    A0  V 108  Trunc=108 Size=6 Line=1 Col=1 Alt=0
Directory = VMSYSU:yourid.
Cmd   Filename Filetype Fm Format Lrecl Records Blocks   Date     Time
_     100001   AUTOSAVE A1 F         80      12      1  5/04/90 21:14:04
      RADIO    WAVES    A1 F         80       3      1  5/04/90 21:12:04
      PICNIC   INGREDTS A1 F         80       3      1  5/04/90 20:58:07
      VACATION CAMPING  A1 F         80       8      1  5/04/90 17:59:00
      CRIME    THEFT    A1 F         80       4      1  5/02/90 15:33:05
      STOCK    INVEN    A1 F         80       7      1  4/25/90 12:10:03










1= Help      2= Refresh  3= Quit    4= Cancel      5= Sort(dir)   6= Sort(size)
7= Backward  8= Forward  9= FL /n  10= Share      11= XEDIT/LIST 12= Cursor

====>
                                                            X E D I T  1 File

Note: Remember that your FILELIST screen will not look exactly like this if your files are stored on minidisks. The directory line will not be shown, and some of the PF keys will have different settings.

Your current RADIO WAVES file would be stored in the file 100001 AUTOSAVE A. You would use the REPLACE option of the COPYFILE command to copy the 100001 AUTOSAVE A file over the RADIO WAVES A file. You would then use the DISCARD command from FILELIST to discard 100001 AUTOSAVE A. The COPYFILE and DISCARD commands are explained in Managing Your Files.

If you entered a SET AUTOSAVE command and you want to find out the file identifier of the AUTOSAVE file and how many changes have been made, you can enter the QUERY AUTOSAVE command. Its format is:
Query AUtosave
A message like the following is displayed:
AUTOSAVE 10; Filename 100001; Alterations : 3

AUTOSAVE 10 is the number you specified in the SET AUTOSAVE command. Filename 100001 means the file name for this AUTOSAVE file is 100001. (The file type is always AUTOSAVE.) If an AUTOSAVE file already exists, the editor picks the next available number. For example, if the file 100001 AUTOSAVE A exists, the editor would name this file 100002 AUTOSAVE A. Alterations : 3 is the number of the changes that have been made. When the number of alterations reaches ten, the file is saved. Every time the file is saved, this number is set back to zero. The number of alterations is also shown in the file identification line (Alt=n).

With some exceptions, every line changed or added counts as an alteration. If you make a correction by typing over words in an existing line in an existing file, that counts as an alteration. On the other hand, all the changes caused by a single command count as one alteration no matter how many lines are affected.

If you enter a SET AUTOSAVE command while you are creating a file, and then enter QQUIT, the file will not be saved. The same is true if you enter a SET AUTOSAVE command while you are revising a file and enter QQUIT. If, however, you have made enough alterations for an automatic save to occur, the AUTOSAVE file will be in permanent storage.