したがって、ジャグ配列の値を検索する関数があり、次のようになります。
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行目のエラーが発生することです。これを修正するにはどうすればよいですか?