home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / pascal / library / dos / murutil / diff.doc < prev    next >
Encoding:
Text File  |  1988-04-18  |  2.9 KB  |  76 lines

  1.                    DIFF -- A File Differences Program
  2.  
  3.  
  4.      DIFF is a Turbo Pascal (V4.0) program which compares two text files
  5. and displays the differences between the two files.  The differences can
  6. be written to an optional output file for later study or printing.
  7.  
  8.      The syntax for DIFF is:
  9.  
  10.                 DIFF A file.ext B file.ext [outfile.ext]
  11.  
  12. where:  "A-file.ext" and "B file.ext" are the files to be  compared  and
  13. "outfile.ext" is the optional output file.
  14.  
  15.      DIFF   is  most  useful  for  finding  subtle  differences  between
  16. programs.  For example, suppose that you have a copy of DIFF.PAS on your
  17. hard disk and another copy on a floppy disk in Drive A.  They  look  the
  18. same but you think they might be different.  You execute  the  following
  19. command:
  20.  
  21.                         DIFF DIFF.PAS A:DIFF.PAS
  22.  
  23. and see the following display on your screen:
  24.  
  25. --------------------------------------------------------------------------
  26. A:   102:    IF FREQ < LOFREQ
  27. A:   103:      THEN
  28. A:   104:        FREQ := LOFREQ
  29. A:   105:      ELSE
  30. A:   106:>       IF FREQ > HIFREQ THEN FREQ := HIFREQ;
  31. A:   107:>   SOUND(FREQ);
  32. A:   108:>   IF DUR < MINDUR
  33. A:   109:>     THEN
  34. A:   110:>       DUR := MINDUR
  35. -------------------------------------
  36. B:   102:    IF FREQ < LOFREQ
  37. B:   103:      THEN
  38. B:   104:        FREQ := LOFREQ
  39. B:   105:      ELSE
  40. B:   106:>       IF FREQ > HIFREQ
  41. B:   107:>         THEN
  42. B:   108:>           FREQ := HIFREQ;
  43. B:   109:>   SOUND(FREQ);
  44. B:   110:>   IF DUR < MINDUR
  45. --------------------------------------------------------------------------
  46.  
  47.      The display shows that the files are different,  starting  at  line
  48. 106 of the files.  (Note that the A-prefix refers to the first file  and
  49. the B-prefix refers to the second file.)   The ">" points to  the  lines
  50. which differ.  Trailing blank characters are ignored.
  51.  
  52.      After DIFF finds and displays a a block  of  differences,  such  as
  53. above, it attempts to "synchronize" the two files so that a missing line
  54. doesn't generate a list of differences to the end of both files.  In the
  55. above example, DIFF was successful and so the differences reported above
  56. are the ONLY differences between the files.
  57.  
  58.      If you hit any key while DIFF is comparing files, DIFF  will  pause
  59. after displaying the next difference block (if any).  You can then abort
  60. DIFF by hitting ESC or control-C, or resume processing  by  hitting  any
  61. other key.
  62.  
  63.      Although I have taken  great  care  in  writing  DIFF,  I  make  no
  64. warranty as to its suitability nor usefulness for any  application,  use
  65. or purpose and I hereby specifically disclaim any responsibility for any
  66. loss or damage resulting from the use of this program, which is herewith
  67. furnished for you to use at your own risk, as you see fit.
  68.  
  69.  
  70. Harry M. Murphy, Consultant
  71. 3912 Hilton Avenue, NE
  72. Albuquerque, NM 87110
  73. Tel:  (505) 881-0519
  74. 18 April 1988.
  75.  
  76.