Home > Software engineering >  An ASCII conversion program do not solve the problem
An ASCII conversion program do not solve the problem

Time:10-15

An ASCII conversion program, but the output value is larger than the original ASCII 1, one output and increase its value and combined with the corresponding figures, such as the input of each + 0, the second 1... ... N + N - 1, for example: 123 ABC input and output of 50,52,54,69,71,73. 1111 by the output of 50,51,52,53 input, but there are often mixed input, output are decimal ASCII,
The following is a code
Dim As Integer I
Dim (a) As String

Private Sub Command1_Click ()
If Text1 & lt;> "" Then
I=0
Text2=""
Timer1. Enabled=True
The Else
MsgBox "please input the content!" , 48, "tip"
End the If
End Sub

Private Sub Form_Load ()
Timer1. Enabled=False
Timer1. Interval=10
End Sub

Private Sub Timer1_Timer ()
Text3. Text=Asc (Mid (Text1. Text, Len (Text1. Text) - I, 1) + 1) + Len (Text1. Text) - I - 1
Text2. Text=Text3 + ", "+ Text2
I=I + 1
If I & gt;=Len (Text1. Text) Then
Timer1. Enabled=False
End the If
End Sub

Operation result is: the only input symbols can not enter the letters and Numbers, when the input 9 49, should be 58, begged for solution

CodePudding user response:

 
Sub ASCII ()
Dim n As Integer
Dim As Integer I
Dim As a String
N=Len (" an ASCII conversion program problem please!" )
A=""
For I=1 To n
A=b & amp; Asc (Mid (" an ASCII conversion program problem please!" , I, 1)) & amp; ", "
Next I
The Debug. Print a
End Sub
  •  Tags:  
  • VBA
  • Related