FillMemory



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

'funzione 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

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