Have you ever lost an entire program because of a bad SAVE that you weren’t aware of, or a system crash that obliterated your program during a SAVE? This happens because most of us SAVE programs repeatedly on the same tape, erasing the previous copy of a program every time we store it on cassette. If you have had this experience (and what programmer hasn’t?) you know the value of keeping at least one current back-up copy on tape of both programs and software that you’re developing.
This is relatively simple for programs that manipulate data but do not require you to SAVE data on a mass-storage device, because you never SAVE over the original.
But what if you have a program that is used several times a week in the course of a few months and is required to accumulate and save data along with the program each time it is used? In this case a single bad SAVE in the course of normal use could wipe out a month or more of data. One solution to this problem is to SAVE the program twice each time you use it, but this still would not protect you from the possibility of having two bad SAVEs ruin your day and it consumes far too much time.
My solution (a rather simple one with a few embellishments) is to SAVE the program on alternating sides of the tape. This method only requires you to SAVE the program once each time you update it, and if a bad SAVE is discovered when the program is next LOADed, there is still a copy of the program and data on the other side of the tape (which has incidentally been verified by its use to be a good copy) and all that has been lost is the data entered in the most recent session.
In the following listing I have incorporated:
1. Instruction to set the computer and tape recorder to minimize human SAVE errors.
2. Program execution of SAVE (therefore program self-starting).
3.Instructions to alternate tape sides.
9900 REM *SAVE TO TAPE*
9905 PRINT " < SAVE REVISED FILES >"
9910 PRINT ,,"LAST TAPE SIDE LOADED: ";B$
9915 IF B$="B" THEN GOTO 9995
9920 LET B$="B"
9925 PRINT ,,,,"TO SAVE THESE FILES....."
9930 PRINT ,," *FLIP TAPE TO SIDE <";B$;"> AND"
9940 PRINT " REWIND TO BEGINNING OF LEADER"
9950 PRINT ,," *PRESS <RECORD> ON TAPE PLAYER"
9955 PRINT " AND HIT THE <RETURN> KEY"
9960 INPUT Z$
9965 PRINT ,,,,"THE PROGRAM + FILES WILL BE"
9970 PRINT "STORED WHEN LEADER HAS PASSED."
9975 PAUSE 450
9980 SAVE ""
9985 CLS
9990 GOTO 900
9995 LET B$="A"
9996 GOTO 9925
Notes On The Listing
- Line 9990 should be used to GOTO the first line of your program to automatically begin program execution.
- You may want to insert a message at the beginning of your program stating that if the program has just been SAVEd, rewind the tape to the beginning and store it before shutting down the computer. This will prevent confusion as to which side of the tape you used last.
This technique is also applicable when you are developing programs. Instead of saving over each successive copy, use the opposite side of the tape. You’ll use a few more cassettes that way but the peace of mind is worth it.
EXAMPLE: FILE PROTECTION
< SAVE REVISED FILES >
LAST TAPE SIDE LOADED: B
TO SAVE THESE FILES.....
*FLIP TAPE TO SIDE <A> AND
REWIND TO BEGINNING OF LEADER
*PRESS <RECORD> ON TAPE PLAYER
AND HIT THE <RETURN> KEY
THE PROGRAM + FILES WILL BE
STORED WHEN LEADER HAS PASSED.
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.