MEM.UnpackArrayOfByte (FUN)

This function of the CAA_Memory.library  unpacks an "ARRAY OF BYTE" in an "ARRAY OF BOOL".

 

abySource[0].0 -> axDestination[0]

abySource[0].1 -> axDestination[1]

...

abySource[1].0 -> axDestination[8]

...

abySource[1].7 -> axDestination[15]

...

The function copies the amount of "uiNumberOfBits" from "abySource" to "axDestination".

The function will return the number of bytes considered in "abySource".

If "pabySource", "paxDestination" or "uiNumberOfBits" are set to "0", the copying will not be carried out and the function will return "FALSE".

提示!

The size of the array "axDestination" has to be adjusted to the number of bits to be copied! Source and target may not overlap!

Input:

pabySource

DWORD

Address of ARRAY OF BYTE

paxDestination

DWORD

Address of ARRAY OF BOOL

uiNumberOfBits

UINT

Number of bits to be copied

Output:

MEM.PackArrayOfBoolToArrayOfByte

UINT

Number of bytes required

Example:

abySource : ARRAY[0..2] OF BYTE :=  16#32, 16#01, 16#00 ;

axDestination : ARRAY[0..9] OF BOOL ;

uiNumberofBytes := MEM.UnpackArrayOfByte(

ADR(abySource), ADR(axDestination), 10) ;

->

uiNumberofBytes = 2

axDestination[0] = FALSE

axDestination[1] = TRUE

axDestination[2] = FALSE

axDestination[3] = FALSE

axDestination[4] = TRUE

axDestination[5] = TRUE

axDestination[6] = FALSE

axDestination[7] = FALSE

axDestination[8] = TRUE

axDestination[9] = FALSE