VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Converts a binary number to decimal.

by John Villa (2 Submissions)
Category: Math/Dates
Compatability: Visual Basic 4.0 (32-bit)
Difficulty: Unknown Difficulty
Originally Published: Tue 19th June 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)

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.




'Combinacion="1101111"
'call Bin2Dec(Combinacion)
'text1.text=combinacion

''[email protected]


Download this snippet    Add to My Saved Code

Converts a binary number to decimal. Comments

No comments have been posted about Converts a binary number to decimal.. Why not be the first to post a comment about Converts a binary number to decimal..

Post your comment

Subject:
Message:
0/1000 characters