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
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
yesterday, I did it, MSGBOX shows 4 4 (4 - find value & 4 item text value) but at comparing strings aren't identical. The cycle is done by the following iteration and function returns -1