home *** CD-ROM | disk | FTP | other *** search
/ No Fragments Archive 10: Diskmags / nf_archive_10.iso / MAGS / ST_USER / 1992 / USERJL92.MSA / COMPARE_CMPFILE.TXT < prev    next >
Text File  |  1987-04-21  |  6KB  |  140 lines

  1. CMPFILE Textfile Comparison Program.
  2. Written by Gordon McNeil.
  3. Version 1.0:  29th February 1992.
  4.  
  5.  
  6. COPYRIGHT NOTICE
  7.  
  8. CMPFILE v1.0 is  not  in  the  public  domain.   It  may  not be
  9. distributed in any form  or  by  any  means  without the express
  10. written consent of the author.
  11.  
  12.  
  13. PROGRAM DESCRIPTION
  14.  
  15. CMPFILE is  a  powerful  textfile  comparison  program.   It was
  16. designed primarily as an  aid  in managing programming projects,
  17. but it could equally  be  used  for  any  purpose which requires
  18. standard ASCII textfiles to be compared.   An example of its use
  19. would be the comparison of two versions of a source code file to
  20. determine whether  any  errors  have  been  introduced  into the
  21. latest version of the code.
  22.  
  23. The  program   will   run   on   any   Atari ST   in   medium or
  24. high resolution.  It features  an  easy  to  use  GEM interface,
  25. intelligent comparison routines and many user-definable options.
  26. It is capable of comparing files of any length.
  27.  
  28. In  addition  to  this  textfile,  you  should  have  the  files
  29. CMPFILE.PRG and CMPFILE.RSC.
  30.  
  31. To use CMPFILE,  simply  enter  the  names  of  the  files to be
  32. compared in  the  fields  at  the  top  of  the  form  and press
  33. <Return>.  The default settings will produce a list of any lines
  34. which differ on the screen.  Press  any key to pause the listing
  35. or <Esc> to  abandon  it.   A  full  description  of the options
  36. available is given below.
  37.  
  38.  
  39. USING CMPFILE
  40.  
  41. 1. Entering the names of the files to compare.
  42.  
  43. The names of the files to  be  compared should be entered in the
  44. fields marked 'File 1' and 'File  2'  on  the form.  They can be
  45. entered directly from the keyboard.  Alternatively, click on one
  46. of the 'Select' buttons to enter the name using the standard GEM
  47. file selector.  If either  of  the  files  are  not  in the same
  48. directory as the program, the  full path specification should be
  49. entered.
  50.  
  51. 2. Listing output.
  52.  
  53. By default, the list  of  differences  is  output to the screen.
  54. This can be changed to  direct  the  listing to either a printer
  55. (connected to the parallel port) or to a diskfile by clicking on
  56. the appropriate option on the form.   If 'Disk' is selected, the
  57. file created will be  named  after  the  first  file entered for
  58. comparison ('File 1' on the form) but with the extension altered
  59. to that specified in  the  'File  ext'  field  of the form.  The
  60. default extension for the differences file is '.MTC'.
  61.  
  62. 3. The list of differences.
  63.  
  64. Two types of differences can be listed:
  65.  
  66.    a) If the same line is present in both files but has been
  67.       altered in one, both lines  are listed giving the line
  68.       number of each within their respective files.
  69.  
  70.    b) If a number of  lines  have  been  added to one of the
  71.       files, the inserted lines are  listed with their line-
  72.       number and are marked off  in  the listing as a 'Block
  73.       Of Inserted Lines'.
  74.  
  75. During comparison, empty lines are  ignored, as are leading tabs
  76. and spaces within each line.
  77.  
  78. The listing can be abandoned at  any  time by pressing the <Esc>
  79. key.  If it is directed to the  screen, it can also be paused by
  80. pressing any other key.
  81.  
  82.  
  83. 4. Program options.
  84.  
  85. By default, file comparison  is  case-dependent: any lines where
  86. even the case of a  character  differs  will  be listed as being
  87. different.  To make the  comparison case-independent, select the
  88. 'Case ind' option.
  89.  
  90. If the  output  listing  is  directed  to  either  a  printer or
  91. diskfile it will not normally be  output to the screen.  To echo
  92. the listing to  the  screen,  select  the  'Echo'  option.  This
  93. option has no meaning if output to screen is already selected.
  94.  
  95.  
  96. 5. Resynchronization.
  97.  
  98. If file  comparison  were  performed  purely  on  a line-by-line
  99. basis, a single inserted line in either of the files would cause
  100. all lines following the inserted  line  to  be reported as being
  101. different.  The files get out  of synchronization.  CMPFILE gets
  102. round this problem by  searching  forward  in  the  files to re-
  103. establish synchronization.  This allows  it  to correctly report
  104. inserted blocks of text within  the  files  in most cases.  This
  105. option should normally be  left  selected.   However,  it can be
  106. switched off by clicking on  the  'Resynch' option.  This speeds
  107. up file-comparison substantially  in  cases  where  neither file
  108. contains inserted lines.
  109.  
  110. A problem created by searching  forward  in  this manner is that
  111. the program can be fooled  by  recurring lines within the files.
  112. Normally, it will be able to recover but will incorrectly report
  113. some lines as differing.   Typically,  this  appears as a report
  114. showing a block of  inserted  lines  in  one  file followed by a
  115. report showing the same block  as  being  inserted in the second
  116. file.  The  likelihood  of  this  occurring  can  be  reduced by
  117. limiting the depth  (i.e.  the  number  of  lines)  by which the
  118. program  searches  forward  in   it's  attempt  to  re-establish
  119. synchronization.  The 'Synch  depth'  parameter  is provided for
  120. this purpose.  The default setting is  24,  but it can be set to
  121. any value between  1  and  99.   If  the  maximum  value (99) is
  122. entered, the search will continue until  the  end of the file is
  123. reached if necessary.  Ideally, it  should  be set to the lowest
  124. value which can cope with the changes made to the file.  Setting
  125. the value as low as  possible  has  two advantages: it speeds up
  126. the comparison and it  reduces  the  probability  of the program
  127. being fooled by recurring lines.
  128.  
  129.  
  130. 6. Online help.
  131.  
  132. During  use  of  CMPFILE,  various   prompts  and  messages  are
  133. displayed in a box at the bottom  of  the form.  If you click on
  134. the 'Help' button, the mouse  cursor  will  change to a pointing
  135. hand.  Clicking on any active  component  of  the form will then
  136. produce a message outlining its function.
  137.  
  138. Finally, click  on  the  button  marked  'CmpFile'  for  further
  139. details of the program.
  140.