home *** CD-ROM | disk | FTP | other *** search
/ ftp.whtech.com / ftp.whtech.com.tar / ftp.whtech.com / club100 / ref / tape.doc < prev    next >
Text File  |  2006-10-19  |  9KB  |  120 lines

  1.  
  2. HOW TO SALVAGE A DEFECTIVE MODEL 100 DOCUMENT FILE ON CASSETTE TAPE
  3.  
  4. by Larry Siebenmann, Berkeley CA
  5.  
  6. SECTION I
  7.  
  8. Who has not mourned the loss of a precious document file; that for some reason (usually obscure) cannot be read back from the cassette tape? The following simple BASIC "salvage" program appeared anonymously in the  newsletter of our Bay Area NEC/100 User's Group, and deserves wide circulation. 
  9.  
  10. (I can now reveal that the authors were in fact Frank Oechsli and Bea Vandenberg.) This program will salvage many a defective .DO file recorded on cassette tape, provided that the Model 100 is able to recognize the opening of the file as it should, printing FOUND <filename>.  Stripped to its essentials the program is so simple it can be easily rembered. 
  11.  
  12.  10 MAXFILES=2: ON ERROR GOTO 100 
  13.  20 SOUND ON: OPEN"CAS:" FOR INPUT AS #1
  14.  30 OPEN"rescue" FOR OUTPUT AS #2
  15.  40 IF EOF(1) THEN END
  16.  50 A$=INPUT$(1,1): PRINT#2,A$;: PRINTA$;
  17.  60 GOTO 40
  18.  100 BEEP: RESUME
  19.  
  20. It is lines 10 and 100 that keep the Model 100 on the salvage job in spite of the damage. That's the main idea of the program; it's simple, but delightlfully effective, and applicable to many computers. To test the program, you can artificially generate reading errors by slowly depressing and releasing the pause key during loading. Normal loading would then terminate with an IO (Input Output) error; but the program BEEPS and perseveres. 
  21.  
  22. In the sidebar ... I offer an embellished version RESCUE.BA tailored for the Model 100. It is worth keeping on file for emergencies. But for the moment read on; we have more to learn. 
  23.  
  24. SECTION II
  25.  
  26. The above program will fail if the Model 100 cannot recognize the file header, and alas, the header is often the first thing to get damaged. But for such occasions I have been successfully using an other trick to save the day.  One has only to make the Model 100 recognize any file header anywhere and then without letting its attention waver make it read the damaged file. 
  27.  
  28. Here is the recipe in detail. With the cassette correctly connected, and volume around 5 or 6 (usually), move the tape to begin play just before any document file header that is undamaged; then start to run the above program listening attentively with your finger on the pause key of the cassette recorder. Depress this pause key as soon as a click is heard from within the Model 100 indicating that the header has been recognized. At this point relax and at your own pace move the tape to the beginning of the damaged file. In most cases this move can be made by depressing the rewind key or the fast-forward key even without releasing the play key. (In troublesome cases it may be necessary to detach temporarily the three leads from the cassette and play the tape to listen for the cacophonous screech that announces the file; one then depresses the pause key again, adjusts the volume to around 5 or 6 again, and reattaches the leads.) Next, one initiates the salvage of the file by releasing the pause key.  When the computer stops, the file RESCUE.DO will contain the salvaged material with black blocks indicating spots where the Model 100 detected an error (delete the 1st command of line 100 if these are annoying). 
  29.  
  30. SECTION III
  31.  
  32. The program may still abort before the whole file is salvaged. In this case, I suggest removing from `RESCUE.DO' the material already salvaged, then repeating the process of the above paragraph with one difference: release the pause key to start the salvage just before the point on the tape where the last salvage operation aborted. It is safest to do this in the tiny space between two data blocks. 
  33.  
  34. Perhaps other users will be able to tell us how to salvage .BA and .CO files; it is a more difficult task. Readers should be reminded that Tandy has, for reasons best understood by itself, reversed the usual roles of the two wires in the (grey) cassette recorder lead used in recording; that is why this lead must be plugged into the AUXiliary socket, rather than into the MICrophone socket as for the sister computers NEC 8201 and Olivetti M10.  To forget this is one fine way to create defective cassette files that will be very hard to salvage. 
  35.  
  36. SECTION IV
  37.  
  38. Incidentally NEC users rarely have to salvage cassette files as above, for the NEC is the proverbial tortoise using a slow but sure baud rate for cassette communication (600 baud compared to 1500 for the Model 100). 
  39.  
  40. Prevention is always better than cure! The old adages concerning tape storage should still be heeded: use tape you can trust (not necessarily expensive tape!), keep the recorder tape head area clean, keep the recorder batteries fresh (or use wall current), and try several volume levels before concluding that a file on tape is defective. Noting the continuing high prices of disk drives, I am sure that a huge number of users must still rely on cassette tape storage. The above tricks do add a measure of safety, making use of the humble cassette recorder more  acceptable. 
  41.  
  42. For files of lesser importance, I now dare to make just one copy, not two or three, and thereby trade off some extra safety for a measure of efficiency. 
  43.  
  44. SIGNED:
  45.  
  46. Larry Siebenmann
  47.  
  48. -------
  49.  
  50. Update #1 From: BILL TEMPLETON
  51.  
  52. NOTE: In order for the program in Larry Siebenmann's recent message regarding the RESCUE.BA program, some minor changes must be made to make it run on a Model 100 as follows: 
  53.  
  54.  10 ON ERROR GOTO 100
  55.  15 MAXFILES=2:SOUNDON:CLS:PRINT
  56.  20 OPEN"CAS:" FOR INPUT AS #1
  57.  30 OPEN"salvge" FOR OUTPUT AS #2
  58.  40 IFEOF(1) THEN BEEP:BEEP:MAXFILES= 1:END
  59.  50 A$=INPUT$(1,#1):PRINT#2,A$;:PRINTA$;:GOTO40
  60.  100 PRINT#2,CHR$(239);:PRINT:PRINT"erl =";ERL;" ;  err =";ERR:BEEP:RESUME
  61.  
  62. The program will run with "#" symbol in lines 20, 30 and 50, although it is not required on the M100.  However, the program will not run with the default setting of MAXFILES=1, and with the filename "Salvage" in line 30! 
  63.  
  64. Update #2 From: BILL TEMPLETON
  65.  
  66. NOTE: Here's my final version of Larry's program (without REMS) that will recover .DO files from bad tape... 
  67.  
  68.  1 MAXFILES=2:ONERRORGOTO15:SOUNDON:CLS:PRINT:SCREEN0,0:E$=CHR$(27):CLS :PRINTE$;"p CASSETTE DOCUMENT FILE RESCUE PROGRAM ";E$"q
  69.  2 PRINT@49,"(heavy weather option)":PRINT"  1. Depress  recorder's pause key as soon as click is heard from your"
  70.  3 PRINT"     Model 100.":OPEN"CAS:"FORINPUTAS#1:PRINT"  2. Release  pause key after moving to      part of tape still to be salvaged.
  71.  4 IFINKEY$=""THEN4ELSECLS
  72.  5 OPEN"RESCUE"FORAPPENDAS#2
  73.  6 A$=INPUT$(1,#1):GOSUB7:GOSUB9:GOTO6
  74.  7 PRINT#2,A$;:PRINTA$;:IF(POS(0)MOD40)=0ANDASC(A$)<>13THENGOSUB14
  75.  8 RETURN
  76.  9 IFEOF(1)=0THENRETURN
  77.  10 BEEP:BEEP:CLS:PRINT@12,E$"p Rescue over! "E$"q
  78.  11 PRINT"   Is tape at end of file?   If not        try again after inspecting and"
  79.  12 PRINT"   evacuating RESCUE.DO. Do a string       search there for blocks`";CHR$(239);"' showing"
  80.  13 PRINT"   where errors were detected.";:END
  81.  14 PRINT@40*(CSRLINMOD7),SPACE$(40);:PRINT@40*(CSRLINMOD7),STRING$(40,255); :PRINT@40*((CSRLIN+5)MOD7),"";:RETURN
  82.  15 PRINT#2,CHR$(239);:PRINT:GOSUB14:PRINT"erl =";ERL;" ;  err=";ERR:BEEP:GOSUB14:RESUME
  83.  
  84. Update #3 From: BILL TEMPLETON
  85.  
  86. NOTE: Change `CPT:' in line 4 to read from one of your current filenames and try my version of Larry Siebenmann's latest RESCUE.BA program. 
  87.  
  88.  0 'RESCUE.BA, Bay area Nec/100 group, 1985
  89.  1 MAXFILES=2:ONERRORGOTO15:SOUNDON:CLS:PRINT:SCREEN0,0:E$=CHR$(27):CLS :PRINTE$;"p CASSETTE DOCUMENT FILE RESCUE PROGRAM ";E$"q
  90.  2 PRINT@49,"(heavy weather option)":PRINT"  1. Depress  recorder's pause key as soon as click is heard from your
  91.  3 PRINT"     Model 100.":PRINT"  2. Release  pause key after moving to     part of tape still to be salvaged.
  92.  4 OPEN"CPT:"FORINPUTAS#1:OPEN"RESCUE"FORAPPENDAS#2
  93.  5 IFINKEY$=""THEN5ELSECLS
  94.  6 A$=INPUT$(1,#1):GOSUB7:GOSUB9:GOTO6
  95.  7 PRINT#2,A$;:PRINTA$;:IF(POS(0)MOD40)=0ANDASC(A$)<>13THENGOSUB14
  96.  8 RETURN
  97.  9 IFEOF(1)=0THENRETURN
  98.  10 BEEP:BEEP:CLS:PRINT@12,E$"p Rescue over! "E$"q
  99.  11 PRINT"   Is tape at end of file?   If not        try again after inspecting and
  100.  12 PRINT"   evacuating RESCUE.DO. Do a string       search there for blocks`";CHR$(239);"' showing 
  101.  13 PRINT"   where errors were detected.";:END
  102.  14 PRINT@40*(CSRLINMOD7),SPACE$(40);:PRINT@40*(CSRLINMOD7),STRING$(40,255); :PRINT@40*((CSRLIN+5)MOD7),"";:RETURN
  103.  15 PRINT#2,CHR$(239);:PRINT:GOSUB14:PRINT"erl =";ERL;" ;  err=";ERR:BEEP:GOSUB14:RESUME
  104.  
  105. RECOVER .DO FILES FROM BAD TAPE
  106.  
  107. by BILL TEMPLETON
  108.  
  109. Try using the following short program to recover your .DO files from tape!  You don't have to use `filename' after CAS: in line 1 if you just want to read the next text file on tape, and you can eliminate: PRINT#2,"***ERROR***"; if you don't want to have this inserted in the resulting SAVE.DO file every time an error occurs... 
  110.  
  111.  1 CLS:MAXFILES=2:OPEN"CAS:filename"FORINPUTAS1:OPEN"save"FOROUTPUTAS2
  112.  2 ONERRORGOTO7:print@133,"Working...
  113.  3 A$=INPUT$(1,1)
  114.  4 IFEOF(1)THEN6
  115.  5 PRINT#2,A$;:GOTO3
  116.  6 CLOSE:MAXFILES=1:MENU
  117.  7 PRINT"Error ="ERR" On line"ERL:PRINT#2,"***ERROR***";:RESUMENEXT
  118.  
  119. <END>
  120.