APPLICATION NOTE #163 SAVING FILES AUTOMATICALLY Rev. 01 RELATED FILES: AUTOSAVE.PGM AUTOSAVE.PGM is a program that saves your file automatically at specific intervals. This application note describes * using AUTOSAVE.PGM * changing the interval at which your file is automatically saved * changing the save/get key to which AUTOSAVE.PGM is assigned This application note also lists the contents of the AUTOSAVE.PGM program. USING AUTOSAVE.PGM To use AUTOSAVE.PGM, first load it to a save/get key. Type: F5ldpm autosave.pgm,s The program is designed to be loaded onto the S key. If you prefer another key, follow the procedure described in the section "Changing the Save/Get Key" and then adjust the Load Program (LDPM) command line accordingly. When you have a file on the screen that you want to automatically save, press the save/get key to which you have loaded AUTOSAVE.PGM. Press: Alt-S (If you do not have a file open on the screen, the program will not start, but will display the message, "No file to save.") The program displays the message, "Ready to save," just prior to automatically saving the file. If you want to stop the program at any time, press the save/get key again. Press: Alt-S The program displays the message, "Auto-save disabled" to let you know that it has stopped automatically saving your file and therefore, you must save your file manually. CHANGING THE INTERVAL BETWEEN SAVES AUTOSAVE.PGM is set up to save your file every 1,000 keystrokes; however, you can easily increase or decrease this interval to suit your needs. 1. Use the CAP (Call Program) command to call AUTOSAVE.PGM to the screen. Type: F5cap autosave.pgm 2. Switch to expanded mode. Press: Ctrl-F9 3. On the first line of the file, find the command that stores a value to SX02. For example: <><><><>< 6. Reload the AUTOSAVE.PGM to the save/get key. Type: F5ldpm autosave.pgm,s CHANGING THE SAVE/GET KEY Use the following procedure to use a save/get key for AUTOSAVE.PGM other than the S key: 1. Use the CAP command to call AUTOSAVE.PGM to the screen. Type: F5cap autosave.pgm 2. Switch to expanded mode. Press: Ctrl-F9 3. On the second line of the file, find the @S function call and put your cursor on the @ character. 4. Move to the command line and use the PFUNC command to assign the function call to the key you want to use. For example, the following command line assigns the function call to the R key. Type: F5pfunc @r Result: A bold @R appears in the program file. 5. Delete the @S that remains in the file. Press: Del 6. Store the file. Type: F5st 7. Reload the AUTOSAVE.PGM to the new save/get key. Type: F5ldpm autosave.pgm,r PROGRAM CONTENT AUTOSAVE.PGM is reproduced below. Remember, if you plan to recreate this program yourself, you must follow the rules for creating a XyWrite program file. For more information, refer to Chapter 5 of the XyWrite III Plus Reference Guide. <><><><><>>><>>><>==<> >><><><><><>+1>><>==<>>>BC saXC <><><><>>(<>-10)>><><><><><>1>><><><><> Note Screen Response. Because this program counts keystrokes, you will notice a decrease in screen response if you are a fast typist.