This is from B4A, how do I do it on B4i, there is no GetValuteAt
B4X:
For i=0 To CityMap.Size-1
City = CityMap.GetValueAt(i)
If City.CompareTo(Main.MYCity) = 0 Then
Main.MyCityCode = CityMap.GetKeyAt (i)
Log("Got City Code")
i = CityMap.Size - 1
End If
Next
If you need to look for a value then either switch the keys and values or use a second map that maps between the cities and the codes.
However you can use this code:
B4X:
For Each CityCode As String in CityMap.Keys
Dim City As String = CityMap.Get(CityCode)
If City.CompareTo(Main.MyCity) = 0 Then
Main.MyCityCode = CityCode
Exit
End If
Next
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.