I noticed that for some reason a boolean stored in a map that was read from a file no longer is a boolean but a string maybe?
I ran some tests where mymap.get("a") is False and mymap.get("b") is False and got this:
Both "a" and "b" value are set with a boolean variable, not string. Like this:
I used to store the map in the keyvaluestore database and worked as expected. This weird behavior started when I moved to save it and read it from a file.
If the mymap is no longer holding a boolean but a string, shouldn't
and
Be the same? Both True? But instead I get False in the first one and True in the second one.
I ran some tests where mymap.get("a") is False and mymap.get("b") is False and got this:
B4X:
Dim mymap As map = File.ReadMap(File.DirInternal,"mymap.txt")
Log(Not(mymap.Get("a") Or mymap.Get("b"))) 'True
Log("false"=False) 'True
Log("false"=True) 'False
Log("true"=True) 'True
Log(mymap.Get("a") = False And mymap.Get("b") = False) 'False
Log(mymap.Get("a") = False) 'False
Log(mymap.Get("b") = False) 'False
Log(mymap.Get("a") = "false" And mymap.Get("b") = "false") 'True
Log(mymap.Get("a") = "false") 'True
Log(mymap.Get("b") = "false") 'True
Both "a" and "b" value are set with a boolean variable, not string. Like this:
B4X:
mymap.put("a",False)
If the mymap is no longer holding a boolean but a string, shouldn't
B4X:
log(mymap.Get("a") = False ) 'False
B4X:
log("false"=False) 'True