ralph
4/11/2012 12:22:00 AM
On Tue, 10 Apr 2012 13:46:36 -0700, Karl E. Peterson <karl@exmvps.org>
wrote:
>Mayayana brought next idea :
>> I've got something that I thought I originally
>> took from your Twiddle Bits code. Maybe not,
>> bu I know I didn't write it:
>>
>> Public Function Bin2Dec(BinaryString As String) As Long
>> Dim X As Long
>> For X = 0 To Len(BinaryString) - 1
>> Bin2Dec = Bin2Dec + Val(Mid(BinaryString, _
>> Len(BinaryString) - X, 1)) * 2 ^ X
>> Next
>> End Function
>
>I thought I'd written one like that myself, but that one's either been
>redone or wasn't done by me. (Just noting stylistic differences - X
>rather than i, no variable after Next, lack of $ after Mid)
>
>I really did like Jim's use of StrRev and slinging it into a Byte
>array, though! Those things weren't there back when I did that
>original set of routines. Far better air code than what I offered!
>:-)
Someone once posted a tongue-in-cheek method where the binary string
was passed by automation to <something>, to fetch a hex string, then
prepended and appended "&"s to the hex string and then passed that to
a conversion function.
Anyone remember that? Or the <something>. It was a hoot at the time.
Can remember the giggles, but not the parties involved.
-ralph