VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



convert from X base to decimal (hex, bin, oct etc...)

by Anonymous (267 Submissions)
Category: Math/Dates
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Sun 9th December 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)

convert from X base to decimal (hex, bin, oct etc...)

Rate convert from X base to decimal (hex, bin, oct etc...)



  For i = 1 To Len(bBin)
    T = B ^ (Len(bBin) - i)
    Char = Mid(bBin, i, 1)
    If Ucase(Char) = "A" Then Char = 10
    If Ucase(Char) = "B" Then Char = 11
    If Ucase(Char) = "C" Then Char = 12
    If Ucase(Char) = "D" Then Char = 13
    If Ucase(Char) = "E" Then Char = 14
    If Ucase(Char) = "F" Then Char = 15 
    TMP2 = TMP2 + (T * CLng(Char))
  Next
  CBin = TMP2
End Function

Download this snippet    Add to My Saved Code

convert from X base to decimal (hex, bin, oct etc...) Comments

No comments have been posted about convert from X base to decimal (hex, bin, oct etc...). Why not be the first to post a comment about convert from X base to decimal (hex, bin, oct etc...).

Post your comment

Subject:
Message:
0/1000 characters