iOS Question [B4X] Casting recomendation

Andrew (Digitwell)

Well-Known Member
Licensed User
Longtime User
With the introduction of casting in the latest versions of the B4X family, I was wondering if it is now recommended to cast all returns from items such as maps.

for example

I have plenty of if statements where I use
B4X:
if (thismap.getdefault("SomeValue",False)) then
...
end if

is it now recommended to use

B4X:
if (thismap.getdefault("SomeValue",False).As(Boolean)) then
...
end if
 

Andrew (Digitwell)

Well-Known Member
Licensed User
Longtime User
Fair enough.
I know there are type conversion issues with

B4X:
if (mymap.getdefault("value",-1) = 1) then
....
end if

which is solved by adding As(Int) or switching the arguments, so I was just wondering if the same was true for boolean.

Cheers
 
Upvote 0
Top