iOS Question So no way to detect null strings?

LWGShane

Well-Known Member
Licensed User
Longtime User
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.
 

LWGShane

Well-Known Member
Licensed User
Longtime User
Figured out what to do: Add a blank ("") item into it at launch. (Adding lists are based off of a SegmentedControl, so the picker has no items at launch)
 
Upvote 0
Top