Bug or Design? Add object list String/Int

qsrtech

Active Member
Licensed User
Longtime User
Hi, not sure if this is by design but I encountered a situation where I was adding an integer value through a variable to a list object, which incidentally was cast from a string. I later tried to use Indexof with a string variable and although the value was theorectically in the list it returned -1

B4X:
Dm MyList as List
MyList.Iinitialize

...

Dim ListValue as int
ListValue=12345
MyList.Add(ListValue)
...

Dim line() as string=regex.split(tab,result)
dim index as int
index=MyList.IndexOf(line(0)) 'line(0)=12345

Do we have to always use indexof with the same variable type as was originally inserted?
 
Last edited:
Top