I am having a weird problem. IIf is messing up when I am working with an array. Apparently it is checking my else statement even though it isn't activated. Here is some code that demonstrates the issue:
'works
Dim test As String = "bleh"
If values.Length < 6 Then
test = "200"
Else
test = values(5)
End If
'throws indexoutofrange exception
Dim itemLimit As String = IIf(values.Length < 6, "200", values(5))