Private Sub Command1_Click()
Dim a As Integer
Dim b As Integer
Dim s As String
Dim yushu As Integer
a = 2138: b = 16
While a <> 0
yushu = a Mod b
s = f(yushu) & s
a = a \ b
Wend
Print s
End Sub
Private Function f(yushu As Integer) As String
If yushu <= 9 Then
f = yushu
Else
Select Case yushu
Case 10, 11, 12, 13, 14, 15
f = Chr(yushu + 55)
End Select
End If
End Function
Dim a As Integer
Dim b As Integer
Dim s As String
Dim yushu As Integer
a = 2138: b = 16
While a <> 0
yushu = a Mod b
s = f(yushu) & s
a = a \ b
Wend
Print s
End Sub
Private Function f(yushu As Integer) As String
If yushu <= 9 Then
f = yushu
Else
Select Case yushu
Case 10, 11, 12, 13, 14, 15
f = Chr(yushu + 55)
End Select
End If
End Function