yoda333,
He's talking about comparing DWORD (a pack of 4 bytes) rather than just individual BYTES. Which may potentially make the process up to 4 times quicker, with minimal effort.
Another idea would be to split the loop, into a control and inner loops. The inner could compare say 32/64 bytes(or longer ) blocks and outer loop steps through the hunks, aborting when chunk doesn't match. It'd need a second loop to handle any left over bytes when the size isn't a multiple of the chunk size.
This helps reduce the loop/function call and comparison overhead as the files get larger. Dunno how well that'd translate to DBPRO though.
Pseudo Code
Status=true
Address=0
Repeat
If (Address+16) < FileSize
; Compare block of 16 bytes
Count= MEMBLOCK DWORD(1, Address) = MEMBLOCK DWORD(2, Address)
Address=Address+4
Count=Count+ (MEMBLOCK DWORD(1, Address) = MEMBLOCK DWORD(2, Address))
Address=Address+4
Count=Count+ (MEMBLOCK DWORD(1, Address) = MEMBLOCK DWORD(2, Address))
Address=Address+4
Count=Count+ (MEMBLOCK DWORD(1, Address) = MEMBLOCK DWORD(2, Address))
Address=Address+4
if Count<>4
Status=false
exit
endif
else
For Address=Address to FileSize-1
if MEMBLOCK BYTE(1, Address) <> MEMBLOCK BYTE(2,address)
Status=false
endif
next
exit
endif
Until Address=>FileSize
Not sure if the command is
MEMBLOCK DWORD or
MEMBLOCK INT in Dbpro. So this is theory only.