MEM.FindBlock (FUN)

This function of the CAA_Memory.library looks for the first occurrence of "MemoryBlockB" within "MemoryBlockA".

It will return 0, if „MemoryBlockB“ cannot be found. Else, the position of its first occurrence will be returned.

Input:

pMemoryBlockA

DWORD

Address of memory area MemoryBlockA

uiLengthBlockA

UINT

Size of area MemoryBlockA in byte

pMemoryBlockB

DWORD

Address of memory area MemoryBlockB

uiLengthBlockB

UINT

Size of area MemoryBlockB in byte

Output:

MEM.FindBlock

UINT

Position of first occurrence, if existent; 0 else.

Example:

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

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

 ->

MEM.FindBlock(ADR(abyMemoryBlockA),10, ADR(abyMemoryBlockB),3) = 7