Computing: Old Operating System Software

@Compare - A diff program for DOS.

I suppose that the expression "diff program" comes from Unix systems, that include all a utility called diff that may be used to compare the content of two (text) files. "@Compare works on ASCII files which are roughly similar to each other (for example, a .pas and its .bak file; a document and an earlier version of the same document; or data created via double data entry). Files to be compared may be of unlimited length. @Compare matches up the two files, displaying them side by side, and displaying the similarities and differences between them. Equal lines are marked by an equal sign on both sides of the screen; discrepancies in similar but unequal lines are highlighted; and lines which exist in one file and which have no corresponding counterpart in the other file are displayed as such". This is how the program is described in its documentation.

@Compare is copyrighted 1988-1999 by Brian C. Madsen, but may be freely distributed, so long as it is accompanied by this documentation, and so long as neither the program nor the documentation is altered in any way.

The program is available for download from the FreeDOS repository at github. The download is a ZIP archive that contains the program folder structure, in the typical way that FreeDOS packages are organized. I unzipped the archive on my Windows 10 and copied the extracted files to a floppy diskette. On my FreeDOS system, I copied the content of the bin folder to C:\freedos\bin, the content of appinfo to C:\freedos\appinfo, and the content of doc\@compare to C:\freedos\doc\@compare (this folder has to be created first).

The program is run as follows:
    @compare [options] <filename1> <filename2>

Running the program without parameters will display its usage with a short explanation of the options available, as shown on the screenshot below.

@Compare diff program on FreeDOS: Program options

Two of these options are of particular interest: /f redirects the program output to a file; /r may be used to compare to column-organized files (cf. further down in the text).

The screenshots below show the comparison of the Modula-2 file fibo.mod with its previous version file fibo.bak. Note the different content in line 12 and the "END" statement present in the old version of the program and removed later.

@Compare diff program on FreeDOS: Comparison of a Modula-2 file with its previous version [I]
@Compare diff program on FreeDOS: Comparison of a Modula-2 file with its previous version [II]

To redirect the program output to a file, specify the /f option before the names of the two files to be compared. The output filename is then asked for; default is @compare.@@@.

The major usage of the /r option is the comparison of two files that contain some data organized in columns. You can compare the values in one or more columns by specifying the column start position and width; you can also specify a label for each column compared, thus you can easier see which data differs in the two files. Running @Compare with the /r option creates two files, called by default @compare.@r@ and @compare.@s@. I haven't understood what's the second file for; when I ran the program, this file was created empty.

I tested this kind of comparison with two modified versions of the data file used by my "Carnivore quiz" Lazarus/Free Pascal application. The files are organized in the following columns: Animal name (columns 1-30), game level (column 31-33) and animal short name (column 35, 64). The screenshot shows the parameter input (just run the program as @compare /r, all parameters will be asked for).

@Compare diff program on FreeDOS: Column organized file compare [I]

The screenshots show the program output (file @compare.@r@ opened in the FreeDOS editor). Unfortunately the program formats the output with lines of 80 characters. This results in fields that will in most cases be too small to fit the information. The result is still useful, but somewhat difficult to read.

@Compare diff program on FreeDOS: Column organized file compare [II]
@Compare diff program on FreeDOS: Column organized file compare [III]

If you like this page, please, support me and this website by signing my guestbook.