home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / cpm / kaypro / pfctwrtr.lbr / SWPREAD.DQC / SWPREAD.DOC
Text File  |  1986-12-02  |  3KB  |  63 lines

  1. SWPREAD          VERS. 1 IN KAYPRO II S-BASIC      MAY 6, 1984
  2.  
  3.      TO READ AND SAVE TEXT FROM PERFECT WRITER SWAP FILE
  4.  
  5.          Inspired by Edmund Bolles (KUGRAM 2:2, 1984)
  6.  
  7. Have you ever lost a text file you were editing due to failure to get
  8. it saved?  Most users of word processors can recall one or more such
  9. disasters.  A power failure, disk drive failure, disk full or bad
  10. sector, keyboard dead due to static shock--these and other causes can
  11. prevent saving your work.  With most text editors the file was forever
  12. lost, but with Perfect Writer virtually all of it is in the swap file
  13. (PW.SWP) on the edit disk.  The problem was getting it out--until now.
  14.  
  15. Edmund Bolles showed how to easily read PW.SWP and save it in a new
  16. file (SWAP.MSS) which can be edited.  The text available in PW.SWP may
  17. be not quite complete and require considerable editing, but it is far
  18. better than nothing.
  19.  
  20. SWPREAD includes several enhancements of the Bolles program, mainly:
  21.  
  22. 1. Execution halts to give self-documentation and to permit changing
  23. disks.  This allows the program to be kept on a separate disk and
  24. never moved.
  25.  
  26. 2. Better rejection of unwanted characters (ASCII over 159) which are
  27. very troublesome when numerous (cursor movement may be extremely slow
  28. and unpredictable).  Some unwanted characters may remain.
  29.  
  30. 3. Does not reject TABs (ASCII 9).
  31.  
  32. 4. Adds EOF (end-of-file, ASCII 26) to SWAP.MSS, needed to prevent an
  33. error message and possible failure when it is read by Perfect Writer.
  34.  
  35. 5. Eliminates brief repetitions which usually occur about every 1000
  36. bytes in PW.SWP.  These repetitions are generally 16-24 characters
  37. long.  They are preceded by ^M (ASCII 13) and are followed by one or
  38. two ^M.  SWPREAD discards any characters between two ^M within 30
  39. characters of each other.  It also discards the ^M, along with many
  40. other "garbage" characters.
  41.  
  42. 6. Runs twice as fast.  
  43.  
  44.                 NOTES
  45.  
  46. SWPREAD is set to read only 62k of PW.SWP.  This is to prevent
  47. accidentally trying to read beyond the end of the usual 64k PW.SWP.  
  48. If your PW.SWP is smaller than 64k, use caution, because reading
  49. beyond its end will cause you to have to start over.
  50.  
  51. If your PW.SWP is larger than 64k and you wish to read more than 62k
  52. of it, increase the 62 on line 32 of SWPREAD.BAS and re-compile it.
  53.  
  54. Do not be concerned that SWPREAD displays your text to the screen in a
  55. form that looks very different from what you wrote.  Carriage returns,
  56. TABs, and paragraphs will reappear when you edit SWAP.MSS.
  57.  
  58. SWPREAD.BAS contains several remarks intended to aid its readability. 
  59. Unexpectedly, a few of these had to be located somewhat illogically in
  60. order for the program to compile.
  61.  
  62. Don Davis, 5603 Bull Creek Rd., Austin, TX 78756iscards any characters between two ^M within 30
  63. char