colorMap keys are color codes and the values are color strings.
The following code does not work;
This code does work;
In the first case I would have expected an implicit conversion from string to integer in the .Get method.
In practice the conversion fails and so the key is not found.
In the second case I force the implicit conversion from string to integer and the key lookup succeeds.
Why would this be so?
The following code does not work;
B4X:
colorSettings.AddList2("Background","Plot background",colorMap.Get(prefManager.GetString("Background")),defGridBkgColor,"",colorMap)
This code does work;
B4X:
Dim x As Int
x = prefManager.GetString("Background")
colorSettings.AddList2("Background","Plot background",colorMap.Get(x),defGridBkgColor,"",colorMap)
In the first case I would have expected an implicit conversion from string to integer in the .Get method.
In practice the conversion fails and so the key is not found.
In the second case I force the implicit conversion from string to integer and the key lookup succeeds.
Why would this be so?