compare Command

Examines two documents for differences in their content.

Scope: Global

Syntax

Parameters

DOCNUM n 
A document specified by Editor document number n.
filename 
The name of a file including, if required, the directory path of that file. If filename is enclosed with " ", the file name and directory path can include blanks if permitted by the file system.
path 
A directory path without a file name. If path is enclosed with "", the directory path can include blanks if permitted by the file system.

path can include the drive name.

Description

The compare command examines two documents for differences in their content. Each document is placed in a new file view, and these new file views are placed side-by-side inside an Editor compare window. Between the two file views, a comparison bar highlights both similar and different sections of the two documents. Options for the compare command can be set from the Compare pull-down menu that appears in the menu bar of the Editor compare window.

If the compare command is issued without any file names or document numbers, there must be exactly two documents open in the Editor. The currently-active document appears in the file view on the left side of the Editor compare window.

If you specify only one file name or document number in the compare command, an Editor compare window opens with the currently-active document in the file view on left side of the window, and the specified document in the file view on the right side of the window.

If comparing two files that have the same name but reside in different directories, you can identify the second document by specifying only its directory location.

File names specified in the compare command that do not already exist will be created.

A document cannot be compared to itself.

Examples

  1. To compare two documents if those two document are the only documents opened in the Editor, type:
    compare
  2. To compare the current document and the config.sys file on your D:\ drive, type:
    compare d:\config.sys
  3. To compare document numbers 4 and 8 that are already opened in the Editor, type:
    compare DOCNUM 4 DOCNUM 8 
  4. To compare the files config.sys and config.old, type:
    compare config.sys config.old
  5. To compare the file config.sys and document number 4 that is already opened in the Editor, type:
    compare config.sys DOCNUM 4 
  6. To compare the files /config.sys and /backups/config.sys, type:
    compare /config.sys /backups
  7. To compare the files d:\config.sys and c:\backups\config.sys, type:
    compare d:\config.sys c:\backups
  8. To compare the file /backups/config.sys with the current document that is called config.sys, type:
     compare /backups
  9. To compare the file \backups\config.sys with the current document that is called config.sys, type:
     compare \backups

API Return Codes

-4 
Document number specified is not in valid range of 1 - 9999.
-6 
Document number specified is not open in the Editor.
-7 
No current document to compare.
-8 
Out of memory in compare.
-11 
Cannot compare document to itself.
-12 
Document failed to load.
-13 
Number of open documents is not two.