"Code smells" are common patterns that can indicate that there is a problem in the code. A problem doesn't mean that the code doesn't work, it might be that it will be difficult to maintain it or that there are more elegant ways to implement the same thing. Remember that not everything is clear...
www.b4x.com
and looked at GetKeyAt and GetValue at of Map.
I take it that if we are only interested in the key or value at one particular index we have to do something like this (although it looks inefficient):
B4X:
Sub GetMapKeyAt(oMap As Map, iIndex As Int) As Object
Dim i As Int
For Each oKey As Object In oMap.Keys
If i = iIndex Then
Return oKey
End If
i = i + 1
Next
Return Null
End Sub
Sub GetMapValueAt(oMap As Map, iIndex As Int) As Object
Dim i As Int
For Each oValue As Object In oMap.Values
If i = iIndex Then
Return oValue
End If
i = i + 1
Next
Return Null
End Sub
[CODE/]
RBS
Because (again an Erel' statement): Note that in most implementations of maps the order is not preserved. In most use cases the order is not important. The order in B4A and B4J maps is preserved. This is not the case in B4i.
Use B4XOrderedMap if you need to access the items based on their index.
The standard Map is not built for such access and it actually iterates over the items internally.