问题
问题Private Sub Form_click()
Dim H As Long
Dim S As String
Dim j As Integer, i As Integer
j = Len(Text1.Text)
i = 1
Do While i <= j
H = Abs(Asc(Mid(Text1.Text, j, 1)))
Do While H > 0
S = Str(H Mod 2) + Trim(S)
H = H \ 2
DoEvents
Loop
Text2.Text = S
j = j - 1
Loop
End Sub
请帮我修改这些代码,我想把文字转为数字,但我希望我输入文字后,在另外一个文本筐输出的数字,输出一个字的asc码(二进制的)就空一个空格,而我的代码是连续输出的,
--------------------编程问答-------------------- Private Sub Form_click()
Dim H As Long
Dim S As String
Dim j As Integer, i As Integer
j = Len(Text1.Text)
i = 1
Do While i <= j
H = Abs(Asc(Mid(Text1.Text, j, 1)))
Do While H > 0
S = (H Mod 2) & S
H = H \ 2
DoEvents
Loop
S = " " & S
Text2.Text = S
j = j - 1
Loop
End Sub
补充:VB , 基础类