[Info-vax] DCL Differences algorithm
John Wallace
johnwallace4 at yahoo.co.uk
Tue Nov 9 07:57:59 EST 2010
On Nov 9, 7:49 am, DTL <didier.mora... at gmail.com> wrote:
> Hello all,
>
> Who could explain the algorithm used by the DCL
> Differences verb, please?
> I'd like to code it in VBScript but I have no clue on how to start.
> Compare lines one by one will break the logic as soon as the first
> different lines are encountered. All next lines will obviously be
> because of the shift. This is this shift concern I wish to be
> documented on.
> Thanks.
>
> DTL DCL is now known as DTL VBS
> :-)
Do you specifically want the algorithm as used by VMS DIFF, or would
the industry standard algorithms do?
And why VBscript? It already exists, pre-coded, pre-tested, in
languages like python. There are also pre-built packages available for
Windows, e.g. GNU for Win32 (name might be wrong).
Anyway, as Glen said (in a different thread?!), the industry standard
implementation (as used in diff on UNIX etc) is a classical example of
dynamic programming. I needed a minor variant on the theme a couple of
years ago (needed to ignore line boundaries) and I couldn't find an
exact match but there were plenty of places to start from. One
starting point would be any decent algorithms book, another starting
point would be somewhere like CodeProject. The code for diff itself is
a bit impenetrable.
Based on that experience, I'm not 100% convinced that VMS DIFF uses
the industry standard algorithm, but (a) I could be wrong (b) it may
not matter for your needs.
More information about the Info-vax
mailing list