home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 6 File / 06-File.zip / VC140.ZIP / VC.KEX < prev    next >
Text File  |  1992-03-20  |  3KB  |  77 lines

  1. * Function:  Run Visual Compare and locate the next and previous deletion or
  2. *            insertion.
  3. * To run:    While editing the second of two files you wish to compare
  4. *            (filetwo), execute the macro VC with a fileone parameter (where
  5. *            fileone is the first of two files you wish to compare).  VC will
  6. *            save the current file (filetwo) if necessary, run Visual Compare
  7. *            (using the /C command line option and with the composite file
  8. *            redirected to the file VC.TMP), load VC.TMP, and locate the first
  9. *            deletion or insertion.  To locate the next deletion or insertion,
  10. *            press the Alt-N key or the key defined by the EDITV variable
  11. *            "vc_next_key."  To locate the previous deletion or insertion,
  12. *            press the Alt-P key or the key defined by the EDITV variable
  13. *            "vc_prev_key."  If the file VC.TMP already exists, execute VC with
  14. *            "!next" for the fileone parameter to load VC.TMP and locate the
  15. *            first deletion or insertion.
  16. * Requires:  KEDIT 4.0
  17. * User set EDITV variables:
  18. *   vc_next_key   default:  "Alt-N"         locate next deletion or insertion
  19. *   vc_prev_key   default:  "Alt-P"         locate previous deletion or
  20. *                                           insertion
  21. *   vc_one_start  default:  "START  $$$$$"  start of deletion
  22. *   vc_two_start  default:  "START  $$$$$"  start of insertion
  23.  
  24. fileone = lower(arg(1))
  25. IF fileone <> '!next' & fileone <> '!prev' THEN
  26.     DO
  27.     IF fileone = '' THEN
  28.         DO
  29.         'emsg Fileone parameter required'
  30.         exit
  31.         END
  32.     filetwo = fileid.1()
  33.     IF alt() THEN
  34.         DO
  35.         'save'
  36.         IF rc <> 0 THEN
  37.             exit
  38.         END
  39.     'kedit .:.\VC.TMP (new noprof'
  40.     IF rc <> 0 THEN
  41.         exit
  42.     'quit'
  43.     'kedit' filetwo '(nodefext'
  44.     * Write the composite file to VC.TMP.  If you are running OS/2, change
  45.     * vcomp to vcompp.
  46.     'dos vcomp' fileone filetwo '/C > VC.TMP'
  47.     END
  48. 'kedit .:.\VC.TMP (noprof'
  49. IF rc <> 0 THEN
  50.     exit
  51. IF size.1() = 0 THEN
  52.     DO
  53.     'quit'
  54.     exit
  55.     END
  56. 'editv get vc_next_key vc_prev_key vc_one_start vc_two_start'
  57. IF vc_next_key = '' THEN
  58.     vc_next_key = 'Alt-N'
  59. IF vc_prev_key = '' THEN
  60.     vc_prev_key = 'Alt-P'
  61. IF vc_one_start = '' THEN
  62.     vc_one_start = 'START  $$$$$'
  63. IF vc_two_start = '' THEN
  64.     vc_two_start = 'START  $$$$$'
  65. * Define key to find the next deletion or insertion.
  66. 'define' vc_next_key '"macro vc !next"'
  67. * Define key to find the previous deletion or insertion.
  68. 'define' vc_prev_key '"macro vc !prev"'
  69. IF fileone <> '!prev' THEN
  70.     * Locate the next deletion or insertion.
  71.     'nomsg locate /'vc_one_start'/ | /'vc_two_start'/'
  72. ELSE
  73.     * Locate the previous deletion or insertion.
  74.     'nomsg locate -/'vc_one_start'/ | /'vc_two_start'/'
  75. IF rc > 1 THEN
  76.     'emsg No more deletions or insertions'
  77.