VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

Converts a binary number to decimal.

John Villa  (2 Submissions)   Math/Dates   Visual Basic 4.0 (32-bit)   Unknown Difficulty   Tue 19th June 2001   Mon 8th February 2021

Converts a binary number to decimal.

API Declarations


'Dim Resultado, Bit, Potencia As Integer
'i = Len(Binario) 'lenght of the binary sent
'While i <> 0 '
'Bit = Mid(Binario, i, 1) 'if the string is 1101111 and the value of 'i' is 3 then, the instruction will return '0'
' If Bit = 1 Then Resultado = 2 ^ Potencia + Resultado
' Potencia = Potencia + 1
' i = i - 1 'read the next bit
'Wend
'Binario = Resultado 'now, the binary number will be a decimal number
'End Function

Rate Converts a binary number to decimal. (2(2 Vote))
Converts a binary number to decimal..bas

Converts a binary number to decimal. Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters