I need to write a program that will do this:
Given a value and a Base, Show a Asc(decimal), Hex, And binary bit pattern.
Since i'm kinda challenged on tackling the problem i tried and made a program that ( or so i believe) displays the bit pattern of the base. If i am correct, where do i go from there?
CODE
Private Sub Command1_Click()
myval = Asc(Text1.Text)
Bit = Val(Text2.Text ^ 7)
bitpattern = ""
Do
If myval < Bit Then
bitpattern = bitpattern & "0"
Bit = Bit / 2
Else
bitpattern = bitpattern & "1"
myval = myval - Bit
Bit = Bit / 2
End If
Loop Until Bit < 1
MsgBox bitpattern
End Sub