Private Sub Command1_Click()
Dim a(1 To 6) As Integer, b(1 To 6) As String, i as integer, j as integer
Dim c As String, k As Integer, tmp1 As Integer, tmp2 As String
s=text1.text
i = 1: k = 1: tmp1 = 0: tmp2 = ""
Do While i <= Len(s)
c = Mid(s, i, 1)
If c = "," Then
a(k) = tmp1: b(k) = tmp2
tmp1 = 0: tmp2 = ""
①
Else
If Then
tmp2 = tmp2 + c
Else
tmp1=tmp1*10+val(c)
End If
End If
i = i + 1
Loop
For i = 1 To 5
For j = 1 To 6 - i
If a(j) > a(j + 1) Then tmp1 = a(j): a(j) = a(j + 1): a(j + 1) = tmp1
If Len(b(j)) > Len(b(j + 1)) Or ② Then
tmp2 = b(j): b(j) = b(j + 1): b(j + 1) = tmp2
End If
Next j
Next i
For i = 1 To 6
List1.AddItem Str(a(i)) + b(i)
Next i
End Sub
① ②