所以我有一个在锯齿状数组中查找值的函数,它是这样的:
Private Function Lookup(ByVal Search_path As String) As Integer
Dim i As Integer = 0
Do Until MasterIndex(i) Is Nothing 'throws an exception here
If Search_path = MasterIndex(i)(0) Then
Return MasterIndex(i)(1)
End If
i = i + 1
Loop
Return -1
End Function
问题是,当我用一个空数组测试它时,它给了我第Index was outside the bounds of the array
3 行的错误。我该如何解决这个问题?