14-01-2007, 07:42 PM
Been looking through some sources, alen is being a pos, even though instructions followed .. bah ...
Use would be ...
The above always result in a runtime error ... now according to the instructions :
Doesn't seem to be accurate. As shown by the code above, I shouldn't receive a runtime error.
Code:
Public Function aLen(ByRef dBytes() As Byte) As Long
On Error Resume Next
aLen = (UBound(dBytes) - LBound(dBytes)) + 1
If Err.Number 0 Then
aLen = 0
Err.Clear
End If
End Function
Use would be ...
Code:
Dim Buffer() as byte
Erase Buffer
Buffer = ""
Buffer = AddByteToBuffer(Buffer, 1)
The above always result in a runtime error ... now according to the instructions :
Quote:'One thing to note, always initialize your byte array to "".
'i.e. dBytes = ""
'This sets the UBound of the byte array to -1, allowing us
'to have a size of 0. If the array is not initialized, or
'you have emptied the array, aLen will cause a RT error.
Doesn't seem to be accurate. As shown by the code above, I shouldn't receive a runtime error.