How do I check if a certain ArrayList index exists?
1 Answer
That depends on what you mean by "exists".
If you mean "If the ArrayList has an index that high", then you need to look at the Count:
If arrayList.Count > yourIndex Then
...
End If
If you mean "Does the ArrayList have a value at that index", just check for a null value:
If arrayList(yourIndex) Is Nothing Then
...
End If
1 Comment
Timo
Can I check in a 2d array for inner values such as i(2)?
sArray = Array(Array("01probe", dbInteger), _ Array("02datum", dbDate), _ Array("03bodenart", dbText, 100, True) _ )