iOS Question [Solved] KeyValueStore with booleans variables

angel_

Well-Known Member
Licensed User
Longtime User
In B4A when I write kvs.GetDefault("BooleanVariable", True) return True or False, but en B4i return 1 or 0.

Reading this thread, How do i to compare values?:
B4X:
If kvs.GetDefault("BooleanVariable", True) then 'is it correct?

'or

If 1 = kvs.GetDefault("BooleanVariable", True) then
 

angel_

Well-Known Member
Licensed User
Longtime User
B4X:
If kvs.GetDefault("BooleanVariable", True) then 'is it correct?
This is correct. It will treat 1 as True.

Second option:
B4X:
If True =  kvs.GetDefault("BooleanVariable", True) Then
Thank you
 
Upvote 0
Top