Sign in Join
FPDoc Onlineexperiment

CompareMemRange function

In unit sysutils

Compare 2 memory locations.

Declaration

pascal
function CompareMemRange(P1: Pointer; P2: Pointer; &Length: PtrUInt)
: Integer

Description

CompareMemRange compares the 2 memory locations pointed to by P1 and P2 byte per byte. It stops comparing after Length bytes have been compared, or when it has encountered 2 different bytes. The result is then

>0
if a byte in range P1 was found that is bigger than the corresponding byte in range P2.
0
if all bytes in range P1 are the same as the corresponding bytes in range P2.
<0
if a byte in range P1 was found that is less than the corresponding byte in range P2.

Errors

None.

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.