Archived

This topic is now archived and is closed to further replies.

DanielH

memcmp in delphi

Recommended Posts

MButchers    123
From the delphi help

CompareMem

Performs a binary comparison of two memory images.

Unit - Sysutils

function CompareMem(P1, P2: Pointer; Length: Integer): Boolean; assembler;

CompareMem performs a binary compare of Length bytes of memory referenced by P1 to that of P2. CompareMem returns True if the memory referenced by P1 is identical to that of P2.

Hope it helps

Mark

Share this post


Link to post
Share on other sites
DanielH    138
I found the function just after i created this thread. But i dont get the function to work like i want to!

CompareMem(@struct,@struct,sizeof(TStruct))

..this returns true but...

struct2 := struct1;
CompareMem(@struct1, @struct2,sizeof(TStruct));

..returns false...

And now i need to compare two diffrent objects from the same record.

How? :o

Share this post


Link to post
Share on other sites