Code Comparison - Between Two Different Code Sets
How to Compare 2 Sets of Code
Requirements: to use this feature, your Visual Expert project must contain multiple applications (sources of code).
Please refer to the following tutorials for creating a project including:
- Click on the "Comparison" tab on the ribbon menu as shown below:
- The right section of the Comparison tab allows you to compare 2 sets of your code.
- Use the dropdown lists to select the sets of code you need to compare.
- Select the required object in the Main Menu and click on ‘Compare 2 sets of code’ in the ribbon menu.
You can choose any scope for your comparison
- You can compare only the objects of a given type.
In this case, select this type of object at the root of the treeview and VE will only compare the corresponding objects (PowerBuilder Windows in the example below, or stored procedures, tables, etc.).
- You can restrict the comparison to a specific object: select this object in the treeview and run the comparison
- You can compare all the objects of a given application: select this application in the section “application” of the treeview and run the comparison.
- You can compare all the objects of a given schema: select this schema in the treeview and run the comparison.
Alternatively, you can click on the "Compare 2 Sets of Code" macro in the Navigation bar.
Important: this option will not appear in the treeview until you properly configure the comparison (Please refer to point 1 to 3 above for more details).
While the Ribbon menu gives a quick access to comparison features, the navigation bar offers more comparison options:
Click the small wrench on the left to open the macro configurations. A popup will allow you to configure the result as per your need.
- Display a complete hierarchy
Allows you to see the result in a complete hierarchy including child objects and components.
- Display comments
Allows you to include comments in the result. This will help you to identify if the comments are added or modified between the two sets of code.
- Show undefined elements
Allows you to include undefined elements in the result (these items are referenced in your code, but Visual Expert could not identify their nature, nor find their definition).
- Click on "Execute" to instantly apply the changes and display the result without saving them.
- Click on "Save" to save the selection for future executions.
The result is displayed in the Main View using different colour highlights for the analysed components:
You can configure multiple "pairs" of sets of code to be compared:
- Click Advanced Settings
- Select the code sets to be compared using the dropdowns
- Click on "+" to add them to the list.
- You can delete a "couple" by clicking on the red cross.
Watch this video tutorial to learn more about code comparison features in Visual Expert.
Also Compare References
Besides finding the changes made in the code of an object, you can also compare the references to this object. Visual Expert will show which references were added or removed to this object, between 2 code analyses.
To do this:
- In the ribbon menu, go to "Comparison".
- Select a previous code analysis to compare with the current one
- Select an object in the treeview
- In the navigation bar, click on "Compare references"