这个是VB语言为啥运行之后显示下标越界?求改
Private Sub Form_Load()
Dim S$
Dim Infor$()
Dim TotalN%
Dim Found As Boolean
Dim N()
Dim PoliceID$
Open App.Path & "\records.txt" For Input As #1
Do Until EOF(1)
TotalN = TotalN + 1
Line Input #1, S
ListTask.AddItem Infor(0)
If Infor(2) = "无效" Then InvalidN = InvalidN + 1
Found = False
For i = 0 To ListPolice.ListCount - 1
If ListPolice.List(i) = Infor(0) Then
Found = True
Exit For
End If
Next i
If Found = False Then
ListPolice.AddItem Infor(0)
End If
Loop
Close #1
ReDim N(ListPolice.ListCount - 1)
For i = 0 To ListTask.ListCount - 1
PoliceID = ListTask.List(i)
For j = 0 To ListPolice.ListCount - 1
If ListPolice.List(j) = PoliceID Then
N(j) = N(j) + 1
Exit For
End If
Next j
Next i
For i = 0 To ListPolice.ListCount - 1
List3.AddItem "警员" & ListPolice.List(i) & "检查的身份证数量为" & N(i)
Next i
txtN.Text = TotalN
txtPercent.Text = Format(InvalidN / TotalN, "0.0%")
End Sub