[fpc-devel]Error in UNITS doc...

peter at freepascal.org peter at freepascal.org
Tue Sep 19 11:17:12 CEST 2000


> Hi,
> 
> I think I found an error in the FPC documentation.
> It's about that command "CompareMem" from the Sysutils unit.
> The doc says that it should give back an integer result, but the
> compiler seems to expect a boolean?!?
> Btw: Is there a function that compares two memory areas (e.g. a small
> pattern within a huge buffer) and gives back the position where
> the pattern is found? Would be very handy if so.

You can use the following FPC specific functions from the system unit 
(available since 1.00):

function  CompareChar(var buf1,buf2;len:longint):longint;
function  CompareByte(var buf1,buf2;len:longint):longint;
function  CompareWord(var buf1,buf2;len:longint):longint;
function  CompareDWord(var buf1,buf2;len:longint):longint;







More information about the fpc-devel mailing list