BList contains values from "1" to "10".
I need to find an element index on its text value.
Simple code below, always returns -1...
Why?! :BangHead:
For example, sValue = 4
Any problem with the Item.Text?
I need to find an element index on its text value.
Simple code below, always returns -1...
Why?! :BangHead:
For example, sValue = 4
B4X:
Sub GetIndexByName(sValue As String) As Integer
For i = 0 To Blist.Count -1
Item.Value = BList.GetItem(i)
If StrCompare(sValue, Item.Text, cCaseInsensitive) = 0 Then Return i 'Dont work!
If sValue = Item.Text Then Return i 'Dont work too!
If sValue = i Then Return i 'It work if i = 4...
Next
Return -1
End Sub
Any problem with the Item.Text?