Object Compare

Using Object Compare, you can compare the contents of two different Natural sources.

Supported object types are: program, dialog, class, subprogram, subroutine, text, local data area, parameter data area, global data area, helproutine, copycode, function, and adapter.

Note:
There is no extra Natural Security support for enabling/disabling the Object Compare plug-in. However, Object Compare uses the system command LIST to read a Natural source. The same Natural Security support that is provided for the LIST command also applies to Object Compare.

This document covers the following topics:


Before You Start

Before Object Compare can be used, you have to proceed as described in the following topics:

Prerequisites

Work file 30 is used. Therefore, the profile parameter WORK must be set to 30 or higher.

An external tool with a graphical user interface for comparing files must have been installed on the PC. An example of such a tool is ExamDiff. A line command compare tool such as diff.exe does not work.

Activating Object Compare

Object Compare has to be activated in the Plug-In Manager. For detailed information on the activation procedure, see Plug-in Manager in the documentation Using Natural Studio.

Elements of Object Compare

When Object Compare has been activated in the Plug-in Manager, additional elements are available in the Natural Studio window:

Context Menu

When the current context (that is, the selected object) allows it, the context menu in the library workspace provides the following additional cascading menu: Object Compare. This cascading menu contains the following commands: Write Left File and Write Right File. See Selecting the Objects to be Compared for further information.

Menu Command

The Tools > Development Tools menu provides the following additional command: Start Object Compare. See Starting Object Compare for further information.

Toolbar

An additional toolbar is shown. The button in this toolbar represents the following menu command:

Toolbar button

Start Object Compare

Note:
The display of this toolbar can be switched on and off by choosing Customize from the Tools menu.

Options Dialog Box

The Options dialog box contains an additional page labeled Object Compare. See Setting the Options for further information.

Setting the Options

When Object Compare has been activated, you first have to set the options for this Natural Studio extension.

Start of instruction setTo set the options

  1. From the Tools menu, choose Options.

    The Options dialog box appears.

  2. Select the Object Compare page in this dialog box.

    Options

  3. Specify the following information:

    External compare tool

    The external tool (including path) that is to be used for comparing files.

  4. Choose the OK button.

Selecting the Objects to be Compared

When you select the objects to be compared, copies of these Natural sources are temporarily stored in the subdirectories left and right of the temporary Natural directory which has been defined in the local configuration file. See Installation Assignments in the Configuration Utility documentation.

If a temporary Natural directory has not been defined in the local configuration file, the copies are stored in the directory defined by the Windows environment variable TEMP or, if TEMP is not defined, in the directory defined by the Windows environment variable TMP.

These copies are the input for the external tool.

Start of instruction setTo select the objects

  1. In the library workspace, select the first object to be compared.

  2. Invoke the context menu and choose Object Compare > Write Left File.

    The code for this object will be shown on the left side of the external tool.

  3. In the library workspace, select the second object to be compared.

  4. Invoke the context menu and choose Object Compare > Write Right File.

    The code for this object will be shown on the right side of the external tool.

Starting Object Compare

When you start Object Compare, the external tool, which has been defined in the Options dialog box, is invoked with the left and right files you have defined last.

Start of instruction setTo start Object Compare

  1. From the Tools menu, choose Development Tools > Start Object Compare.

    Or:
    When the Object Compare toolbar is shown, choose the following toolbar button.

    Toolbar button

    The following dialog box appears. It shows the file names that are used in the temporary directories. The file names are composed of the following information: host and port (only shown when an object has been selected on a remote development server), database ID, file number, library name, name of the selected object and an extension which indicates the type of Natural object.

    Files to be compared

  2. Choose the OK button to invoke the external tool.