When a boolean is evaluated without using a variable it seems to not correctly interpret the result:
I guess this error is related to this other:
B4X:
Sub MenuList_Click (returnName As String)
Dim Number1 As Double = 3
Dim Number2 As Double = 5
Dim Operation As String = "sum"
Log(Operation = "sum") 'return sum
Log(Operation = "subtract") 'return subtract
Log(MyFunction(Number1, Number2, Operation = "sum")) 'return 8
Log(MyFunction(Number1, Number2, Operation = "subtract")) 'return 8
End Sub
Sub MyFunction(a As Double, b As Double, Operation As Boolean) As Double
Dim Result As Double
If Operation Then
Result = a + b
Else
Result = a - b
End If
Return Result
End Sub
I guess this error is related to this other:
[BANano] Evaluate boolean function
I try to evaluate the function but the results returned are not what I expected, what am I doing wrong? Sub WelcomePageButton_Click (event As BANanoEvent) Log(IsCheckOk("ab")) 'Return ab Log(IsCheckOk("cd")) 'Return ab Log(IsCheckOk("de")) 'Return ab End Sub Sub...
www.b4x.com