Description: Apple Writer II: DOS Version--Recovering "Lost" Text Files Header: Apple Writer II: DOS Version--Recovering "Lost" Text Files At times you run the risk of saving a short text file over a text file of greater length. You might, for instance, save the empty Apple Writer editor workspace with the same name of a valuable document. This prevents the system accessing the original contents of the file. While the data is still on the diskette, you have made it unaccessable to the system. This program accesses the data so that the system may recover your original file. This program has been tested on Apple Writer II and Apple Writer IIe files. It works with standard DOS Text files, signified by a T in the left margin of a catalog listing. This program does not operate with the ProDOS version of Apple Writer. 10 TEXT : NORMAL : HOME 20 INPUT "ENTER THE FILE NAME TO BE READ ";F$ 30 INPUT "FIRST BYTE TO READ ";C 40 ONERR GOTO 200 50 D$ = CHR$(4) 60 PRINT D$;"OPEN "F$",L1" 70 PRINT D$;"OPEN NEW";F$ 80 B$ = "" 90 PRINT D$;"READ "F$",R";C 100 GET A$ 110 C = C + 1 120 IF (ASC (A$) = 13) GOTO 170 130 B$ = B$ + A$ 140 PRINT 150 IF (LEN (B$) > 254) GOTO 170 160 GOTO 90 170 PRINT : PRINT D$;"WRITE NEW";F$ 180 PRINT B$ 190 GOTO 80 200 PRINT : PRINT D$;"CLOSE ";F$ 210 PRINT D$;"CLOSE NEW";F$ 220 END 1. Type in the program and save it on your DOS disk. Run it. 2. After the program requests the name of the file that is to be recovered, type in the name giving slot and drive specifications in necessary--e.g., MYFILE, S6, D2. 3. Next the program prompts you for the first byte that you want to read from the file. You type in a number which should be: a. an integer between 1 and 32768 b. the size, in bytes, of the file that was accidentally saved plus 1. To find the size of this accidentally saved file, [L]oad it under Apple Writer. The size of the file is displayed on the data line after the length entry Len:. Add one to this count and type in the result. 4. Once you have typed in your information, give the program time to run and write the entire file. To read part of the file and the write the new file, the program may go back to the drive several times, so please be patient. The cursor will come back to the screen when the program is finished. Apple Technical Communications Keywords: