B4X:
Sub CalculateBtn_Click
Dim Level As String
Dim Score As Int
If LevelPicker.GetSelectedItem(0) = Null Then 'Where the error occurs.
Msgbox ("Please select a mode and then a level!", "Error: No Level")
Else If ScoreField.Text.Length = 0 Then
Msgbox("Please enter a score bigger than ""0""", "Error: Score is ""0""")
Else
Level = LevelPicker.GetSelectedItem(0)
Score = ScoreField.Text
End If
End Sub
No matter what I try, I always keep ending up with an "index 0 beyond bounds for an empty array" error.