I am having trouble converting from a Byte Array to a Signed Integer in VB6. This would be simple to do with BitConverter in .NET but I'm not sure what to do with VB6. Thanks
Unfortunately no built in function, you need to write one. Here is a quick sample to get you started.
Private Function BArrayToInt(ByRef bArray() As Byte) As Integer
Dim iReturn As Integer
Dim i As Integer
For i = 0 To UBound(bArray) - LBound(bArray)
iReturn = iReturn + bArray(i) * 2 ^ i
Next i
BArrayToInt = iReturn
End Function
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With