为实现上述的功能的程序如下,加框处的代码有误,请改正。
Dim book(1 To 20) As String, st As String
Const n = 20
Private Sub Form_Load()
'读入n个数据,存储在数组book中,并显示在列表框List1中
End Sub
Private Sub Command1_Click()
Dim i As Integer, j As Integer, len1 As Integer, len2 As Integer,k As Integer
st = Text1.Text
List2.Clear
len1 = Len(st)
k = 0
For i = 1 To n
len2 = Len(book(i))
'①
Do While j <= len2 - len1 + 1
If Then '②
List2.AddItem book(i)
k = k + 1
End If
j = j + 1
Loop
Next i
If k> 0 Then
List2.AddItem “共找到”+Str(k) + “条信息”
Else
List2.AddItem “查无此书”
End If
End Sub
程序中加框①处应改正为;
加框②处应改正为。