[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] | Reference for unit 'sysutils' (#rtl)

# CompareMem

Compare two memory areas.

## Declaration

Source position: sysstrh.inc line 84

`function CompareMem(`
`P1: Pointer;`
`P2: Pointer;`
`Length: cardinal`
`):Boolean;`

## Description

CompareMem compares, byte by byte, 2 memory areas pointed to by P1 and P2, for a length of L bytes.

It returns the following values:

<0
  if at some position the byte at P1 is less than the byte at the same postion at P2.
0
  if all L bytes are the same.
>0
  if at some position the byte at P1 is greater than the byte at the same postion at P2.

The latest version of this document can be found at lazarus-ccr.sourceforge.net.