Quote:
Originally posted by Eyes.Only
a byte array is a lot like a string except it holds single bytes, thus you need the array to hold more then one. To use one you would dim the array first then when u know the length of the file, redim the array.
but i dunno any advantage of a byte array over a regular string
and comparing those
A string takes up twice as much memory as the byte array.
VB Code:
Dim b1() As Byte, b2() As Byte
Open FileName1 For Binary As #1
ReDim b1(LOF(1) - 1) 'we take of one since the array is zero based
Get #1, , b1
Close #1
Open FileName2 For Binary As #1
ReDim b2(LOF(1) - 1)
Get #1, , b2
Close #1
If StrComp(b1, b2) = 0 Then
MsgBox "The files are the same"
End If
Best regards