-----Original Message-----
I would use 0x1010101010 in c, but how do I do it in vb? thanks!
.
Assuming that you need to use the format 0x1010101010
rather than the integer form 682 (I'd be curious to know
why?) and if that sort of thing is something you do
often, you might just want to use it as a String and
create a function (even in another template) that would
parse the string into an integer, I'm thinking something
like this:
Function bin2int(sBin As String)
Dim intForm As Integer: Set intForm = 0
binLen = Strings.Len(sBin)
For i = 1 To binLen - 2
power = 2 ^ i
intForm = intForm + power * CInt( _
Strings.Mid(String:=sBin, Start:=binLen - CLng
(i), Length:=1))
Next i
' MsgBox to evaluate output; remove or comment out when
done
MsgBox (sBin + " --> " + intForm)
bin2int = intForm
End Function
I haven't tested it, but it should be a good start on
such a function. Hope this helps!