Home

Awesome

Text compare component for Delphi and Free Pascal

Source code for the freeware component TDiff is written in Delphi. This component dramatically simplify programming tasks that require calculations of 'shortest path' or 'longest common sequence' as typically required in file compare utilities.

TDiff is used in RJ TextEd to compare text or source files. You need to add the units "DiffTypes" and "Diff" to the uses section of your application.

The units "Diff_NP" and "Diff_ND" contains the available algorithms that can be used from the TDiff class.

PDF documents fully describing the principle algorithms used in Diff_NP and Diff_ND...
The algorithm in the Diff_ND unit is based on: "An O(ND) Difference Algorithm and its Variations" by E Myers - Algorithmica Vol. 1 No. 2, 1986, pp. 251-266
The algorithm in the Diff_NP unit is based on: "An O(NP) Sequence Comparison Algorithm" by Sun Wu, Udi Manber & Gene Myers

Getting Started

Download the files and include the units DiffTypes and Diff in your project.

Demo applications

Two very simple demo applications (with full source code) are include to demonstrate how the 'TDiff' component can be used in Delphi and Lazarus programs.

Authors

Author : Angus Johnson - angusj-AT-myrealbox-DOT-com
Copyright : © 2001-2008 Angus Johnson
Updated by : Rickard Johansson (RJ TextEd)

Version history