Vyom World.com Let's Touch the Sky Together!
 Home VyomWorld.com Home Free Magazines! VyomLinks.com Home JobsAssist.com Home Vyom Network Contact Us Jobs & Careers Resume Submitter Placement Papers IT Companies Directory Computer Jobs Interview Questions Online Exams Vyom Career eMag. Fun Screensavers New! Send FREE SMS! SMS Jokes Source Codes Library Source Codes Home ASP Source Codes C Source Codes C++ Source Codes COBOL Source Codes Java Source Codes Pascal Source Codes Submit Source Codes GATE GATE an Overview GATE Preparation Study Materal GRE GRE an Overview GRE Questions GRE Preparation GRE Universities TOEFL Preparation TOEFL Resources GMAT Preparation GMAT Resources MBA Preparation MBA Resources Networking Concepts Networking Concepts Testing Preparation Testing Resources Webmasters Free Traffic Builder Webmaster Articles Web Hosting Tutorials Hardware Tutorial 1500 Free eBooks New! FREE Publications
Vyom Career eMag.
 Get 9,000+ Interview Questions & Answers in an eBook. 9,000+ Interview Questions All Questions Answered 5 FREE Bonuses Free Upgrades Get it now!
Get 9,000+ Interview Questions with Answers in an eBook

Home >> Source Codes Library Home >> Language Home >> Category Home > > Item Description
Search Code Library

 Title Number to Decimal Description: Converts a base to decimal Hits: 1714 Since 25th November, 2003 Code: Select and Copy the Code Function Any2Dec(ByVal otherBaseNumber As String, ByVal base As Integer) As Long Dim index As Long Dim digits As String Dim digitValue As Long ' check base If base < 2 Or base > 36 Then Err.Raise 5 ' get the list of valid digits digits = Left("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ", base) ' convert to decimal For index = 1 To Len(otherBaseNumber) ' get the digit's value digitValue = InStr(1, digits, Mid\$(otherBaseNumber, index, 1), _ vbTextCompare) - 1 ' error if invalid digit If digitValue < 0 Then Err.Raise 5 ' add to running result Any2Dec = Any2Dec * base + digitValue Next End Function

ASP Home | C Home | C++ Home | COBOL Home | Java Home | Pascal Home