Compare versions of Scripts using Diff Library

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4213
Joined: Sun Jan 07, 2007 9:12 pm

Compare versions of Scripts using Diff Library

Post by bn » Mon Mar 09, 2026 10:29 am

When developing I often save the whole stack with an increasing version number. When going back to a previous version it can be hard to detect the differences between two versions.
There are probably many solutions out there to tackle this problem.

I used the diff library that is included in LC since version 9 to make a GitHub style diff that helps to show the differences.

This might also be useful to others. Click on the question mark to see a help text.

Kind regards
Bernd
Attachments
Find Differences in code_0.4.livecode.zip
(7.78 KiB) Downloaded 45 times

maxwellhart89
Posts: 1
Joined: Fri Apr 03, 2026 7:35 am

Re: Compare versions of Scripts using Diff Library

Post by maxwellhart89 » Fri Apr 03, 2026 7:38 am

That’s a useful approach, especially for tracking script changes across stack versions. Does your diff also handle object properties and UI changes, or mainly code differences?

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10477
Joined: Wed May 06, 2009 2:28 pm

Re: Compare versions of Scripts using Diff Library

Post by dunbarx » Fri Apr 03, 2026 10:07 pm

Bernd.

Oooh. Will check this out.

Craig

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4213
Joined: Sun Jan 07, 2007 9:12 pm

Re: Compare versions of Scripts using Diff Library

Post by bn » Sat Apr 04, 2026 10:35 am

The stack has 2 fields where you put the scripts to compare. You can use the whole scripts with all handlers and put them into their fields ("old" and "new"). If you put two completely different texts the diff can take a long time and you might want to interrupt it with command + ".".
The stack does not check whole stacks or anything else you want to compare.

Kind regards
Bernd

Post Reply