填空题
执行下列程序,单击Command1按钮后,列表框上共显示
1个列表项,其中第一个列表项内容为
2,最后一个列表项内容为
3。
Option Explicit
Private Sub Command1_Click()
Dim st As String, p As String*1, i As Integer, js As Integer
st="abbcccdee"
p=Mid(st, 1, 1)
js=1
i=1
Do Until i>Len (st)
If Mid(st, i, 1)=p Then
js=js+1
Else
List1.AddItem p&":"&js
p=Mid(st, i, 1)
js=1
End If
i=i+1
Loop
List1.AddItem p&":"&js
End Sub