home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Professional
/
OS2PRO194.ISO
/
os2
/
prgramer
/
vcomp
/
vc.kex
< prev
next >
Wrap
Text File
|
1992-03-05
|
3KB
|
77 lines
* Function: Run Visual Compare and locate the next and previous deletion or
* insertion.
* To run: While editing the second of two files you wish to compare
* (filetwo), execute the macro VC with a fileone parameter (where
* fileone is the first of two files you wish to compare). VC will
* save the current file (filetwo) if necessary, run Visual Compare
* (using the /C command line option and with the composite file
* redirected to the file VC.TMP), load VC.TMP, and locate the first
* deletion or insertion. To locate the next deletion or insertion,
* press the Alt-N key or the key defined by the EDITV variable
* "vc_next_key." To locate the previous deletion or insertion,
* press the Alt-P key or the key defined by the EDITV variable
* "vc_prev_key." If the file VC.TMP already exists, execute VC with
* "!next" for the fileone parameter to load VC.TMP and locate the
* first deletion or insertion.
* Requires: KEDIT 4.0
* User set EDITV variables:
* vc_next_key default: "Alt-N" locate next deletion or insertion
* vc_prev_key default: "Alt-P" locate previous deletion or
* insertion
* vc_one_start default: "START $$$$$" start of deletion
* vc_two_start default: "START $$$$$" start of insertion
fileone = lower(arg(1))
IF fileone <> '!next' & fileone <> '!prev' THEN
DO
IF fileone = '' THEN
DO
'emsg Fileone parameter required'
exit
END
filetwo = fileid.1()
IF alt() THEN
DO
'save'
IF rc <> 0 THEN
exit
END
'kedit .:.\VC.TMP (new noprof'
IF rc <> 0 THEN
exit
'quit'
'kedit' filetwo '(nodefext'
* Write the composite file to VC.TMP. If you are running OS/2, change
* vcomp to vcompp.
'dos vcomp' fileone filetwo '/C > VC.TMP'
END
'kedit .:.\VC.TMP (noprof'
IF rc <> 0 THEN
exit
IF size.1() = 0 THEN
DO
'quit'
exit
END
'editv get vc_next_key vc_prev_key vc_one_start vc_two_start'
IF vc_next_key = '' THEN
vc_next_key = 'Alt-N'
IF vc_prev_key = '' THEN
vc_prev_key = 'Alt-P'
IF vc_one_start = '' THEN
vc_one_start = 'START $$$$$'
IF vc_two_start = '' THEN
vc_two_start = 'START $$$$$'
* Define key to find the next deletion or insertion.
'define' vc_next_key '"macro vc !next"'
* Define key to find the previous deletion or insertion.
'define' vc_prev_key '"macro vc !prev"'
IF fileone <> '!prev' THEN
* Locate the next deletion or insertion.
'nomsg locate /'vc_one_start'/ | /'vc_two_start'/'
ELSE
* Locate the previous deletion or insertion.
'nomsg locate -/'vc_one_start'/ | /'vc_two_start'/'
IF rc > 1 THEN
'emsg No more deletions or insertions'