| |
Parabellum
Posts: 222
Score: 0
Joined: 11/12/2006
From: UK
Status: offline
|
after a bit of searching around.... i was unable to find a builtin function or simapl way of converting a binary number to decimal... i found the hex function for hex to decimal, but nothing for binary. I wote this little script to do the job.... but i was wondering if there is a simpler way i'm missing??? Option Explicit Dim myVal, binVal, i, strLength, num, endVal myVal = inputBox("Enter Binary Number") BinToDec(myVal) Function BinToDec(binVal) strLength = Len(binVal) For i=0 to strLength-1 num = mid(binVal,strLength-i,1) endVal = endVal + num*(2^i) Next MsgBox endVal End Function
< Message edited by Parabellum -- 1/31/2008 7:59:03 AM >
|
|