ArrayBoolean



Declare Sub FillMemory Lib "kernel32" Alias _
"RtlFillMemory" ( BlockToFill As Any, ByVal dwSize _
As Long, ByVal chValue As Byte)

'Riempie un array di Boolean col valore specificato usando

'la API 'FillMemory


Public Sub FillArrayBool(bArray() As Boolean, ByVal _
bValue As Boolean)

Dim lPrimo As Long, lUltimo As Long, lElementi As Long
Dim iSize As Integer, chValue As Byte

lPrimo = LBound(bArray)
lUltimo = UBound(bArray)
lElementi = lUltimo - lPrimo + 1
iSize = Len(bArray(lPrimo))

If bValue Then
chValue = 255 '&HFF: se bValue = False chValue = 0
End If

FillMemory bArray(lPrimo), lElementi * iSize, chValue

End Sub

(arrayboolean.html)- by Paolo Puglisi - Modifica del 25/3/2019