To obtain this behavior in B4X, you can do the following:
1. Declare a global Map
2. Initialize the Map
3.Enjoy
1. Declare a global Map
B4X:
Sub Process_Globals
...
Dim TF as Map
...
End Sub
B4X:
Sub Activity_Create(...)
...
TF.Initialize
TF.Put(False, 0)
TF.Put(True , 1)
...
End Sub
3.Enjoy
B4X:
Sub isOver9000(powerLevel As Int) As Boolean
Return powerLevel > 9000
End Sub
Log(TF.Get(isOver9000(23847)) '1
Log(TF.Get(isOver9000( 589)) '0