MEM.Compare (FUN)

This function of the CAA_Memory.library compares "MemoryBlockA" with "MemoryBlockB". The amount of "uiNumberOfBytes" will be checked.

The function will return 0, if the areas are identical. If not, the position of the first discrepancy occurred will be returned.

Input:

pMemoryBlockA

DWORD

Address of memory area  MemoryBlockA

pMemoryBlockB

DWORD

Address of memory area MemoryBlockB

uiNumberOfBytes

UINT

Number of bytes to be checked

Output:

MEM.Compare

UINT

Position of first discrepancy, if existent; 0 else.

Example:

abyMemoryBlockA : ARRAY[0..9] OF BYTE := 0,1,2,3,4,5,6,7,8,9 ;

abyMemoryBlockB : ARRAY[0..9] OF BYTE := 0,1,2,0,4,5,6,7,8,9 ;

->

MEM.Compare(ADR(abyMemoryBlockA),

ADR(abyMemoryBlockB),10) = 4