Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
procedure BinToDec
lparameters tcBinary
lnRetVal=0
lnSeed=1
For X = Len(tcBinary) To 1 Step -1
lnRetVal=lnRetVal+IIF(SUBSTR(tcBinary,X,1)='1',lnSeed,0)
lnSeed=lnSeed*2
Next
return lnRetVal
endproc
procedure DecToBin
lparameters tnDecimal
lnDecimal=tnDecimal
lcRetVal=''
lnSeed=1
do while lnSeed <= lnDecimal
lnSeed=lnSeed*2
enddo
lnSeed=lnSeed/2
do while lnSeed >= 1
If lnSeed <= lnDecimal
lnDecimal = lnDecimal-lnSeed
lcRetVal=lcRetVal+'1'
else
lcRetVal=lcRetVal+'0'
endif
lnSeed=lnSeed/2
enddo
return lcRetVal
endproc