Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Find differences between 2 strings/files; patch
Macro Xdiff help
Copy      Help
;Finds differences between two strings or files.
;Patches a string or file.
;Merges 3 strings or files.
;Supports text (unified) and binary diff.

;Based on LibXDiff: <link></link>
;Setup: move xdiff.dll to qm folder.
;What is a unified diff: <link></link>


#compile "__Xdiff"
Xdiff x
str s1="one[]two[]three[]four[]five[]six[]eight[]"
str s2="one[]twoo[]thre[]four[]six[]seven[]eight[]"
str sd
x.DiffText(s1 s2 sd 0)
out "---- diff ----"
out sd
out "---- patched ----"
str s2Patched
x.PatchText(s1 sd s2Patched)
out s2Patched

Attached Files
.zip (Size: 21.4 KB / Downloads: 830)
Hi, good day.

I need  compare macros. I'm trying to use function "Compare2Macros", but I'm having a error message when run de Function. This is the message that I got:

Error in __xdiff_api: dll not found or failed to load

The specific line in _xdiff_api is:

dll "$qm$\xdiff" #xdl_set_allocator memallocator_t*malt

I've the xdiff.dll file in QM directory's. I'm using the QM version: in a 32 bits SO

I searched for similar problem in internet, but I can't find information or something about the how to resolve it.

Can you help me please ?

Thanks in advance.
Run this macro. What is the result text?

Copy      Help
str path.expandpath("$qm$\xdiff.dll")
out path

str s.getfile(path)
out s.encrypt(2|4)

int h = LoadLibraryW(@path)
if(!h) end ERR_FAILED 16
out h
Hi again. My apologies for my late response.

I do what you say, this is the first result:

C:\Program Files\Quick Macros 2\xdiff.dll
Error (RT) in <open ":3510: /55">Macro20:  cannot open file: The system cannot find the file specified. (0x2).    <help #IDP_ERR>?

Then, I redistributed the xdiff.dll and this was the second result:

C:\Program Files\Quick Macros 2\xdiff.dll

Now the macro works fine.

As always, very professional and accurate diagnosis.

Have a good year 2023 and my congratulations on your product, for me it is exceptionally good and useful.

Greetings from Chile.


Forum Jump:

Users browsing this thread: 1 Guest(s)