convert base 10 to any other base

Category:
Dates and Math
Type:
Snippets
Difficulty:
Beginning
Author:
David Hill

Version Compatibility: Visual Basic 6, Visual Basic 5

More information:
The first parameter is an integer double, the second parameter is the digits of the base you wish to use. If you pass in "01" as the second parameter it will convert to binary. If you pass in "0123456789ABCDEF" as the secon parameter it will convert to hex. If you want to make up your own base 36 numbering scheme (as we did), no problem. This routine is simple, flexible, and converts to any integer number base you can imagine.

Instructions: Copy the declarations and code below and paste directly into your VB project.

Declarations:

Code: