>>Only problem here is that it's off by one.
>
>Sorry for not understanding, but what do you mean with this.
It yields the wrong result. In the example (01010) equals 10. Your method returns 20. Why? Because integers are base zero in the way they are numbered. However, the following does work
lndec = 0
lnLenght = Len(lcBin)
For lnTel = 1 to lnLenght
lnDec = iif(SubStr(lcBin,lnLenght-lnTel+1,1)='1',BitSet(lnDec,lntel <b>- 1</b>),lnDec)
EndFor
Hence, you're off by one.
George
Ubi caritas et amor, deus ibi est