Before you begin, you must complete Exercise 3.11: Searching multiple files.
If your product undergoes many changes, you will find the Compare utility useful. It allows you to compare different versions of a program and find the differences. There are two ways to do a compare: use the Compare utility in the workbench or use the Compare utility in the CODE tool. The compare in the CODE tool is more intuitive but requires you to start the CODE Editor outside of the workbench.
Using the compare utility in the workbench you can view the differences between two files by comparing them. You can compare different files, and you can compare versions in the Workbench with versions in the repository or with the local edit history.
After a comparison is carried out, the Compare Editor opens in the editor area. In the compare Editor, you can browse through all the differences and copy highlighted differences between the compared resources. You can save changes to resources that are made in the comparison editor.
Using the compare utility in CODE you can also view the differences between two files by comparing them. You enter a name of a file to compare against the file in the CODE Editor view. You can type the name of a file, or you can select one from the list of files already open in the editor. If you type the name of the file that is not already open in the editor, it is loaded into the editor. If no file is specified, the current file is compared against a new, untitled file. The current file appears on the left side of the Compare view, and the specified file on the right. You use the Compare menu to view the next and previous mismatch and to select options such as ignore case, font, protect view and show mismatches only.
To compare files in the workbench:
The Preferences window opens.
In the right pane of the Preferences window make sure that the Ignore blanks check boxes are selected.
The Compare window opens.
The editor now will show the differences of these two members PAYROLLC and PAYROLLC2 .
You can move from mismatch to mismatch by using the Compare menu under the Edit menu.
Mismatches in PAYROLLC and PAYROLLC2 are highlighted in different colors so
that you know where the mismatched lines are in each file.
Next, end the compare session.
You have compared different versions of the program and found the differences and now you are ready to begin Exercise 3.13: Comparing files in the CODE Editor (optional).
(C) Copyright IBM Corporation 1992, 2005. All Rights Reserved.