I don't know if this applies to you but here's a little function I wrote
years ago to to take the 2's complement of the Mod 256 sum of the data bytes
in the string if interest....
Private Function CheckSum(TheString As String, TheLength As Integer) As
String
Dim TempCheckSum As Integer
Dim i As Integer
For i = 1 To TheLength
TempCheckSum = (TempCheckSum + Asc(Mid$(TheString, i, 1))) And &HFF
Next i
CheckSum = Chr$((-TempCheckSum) And &HFF)
End Function
I seem to remember returning a string since I was just appending it the
TheString.
"krollenhagen" <v
...@nospam.rollenhagen.us> wrote in message
news:17EE96A9-8EEE-4832-BEF1-57533DC452CA@microsoft.com...
> Hello-
> I am trying to take the 2s complement of a number. I have converted the
number into a binary string and then negated the string using if..then
statements. I can then convert this into a decimal value easily enough.
> I am wondering if there is an easier way to do this?
> Just wondering,
> Keith