Hi Everyone,
Is there a function in B4A that you can pass in a number and the function returns true if the number is within a range?
Example:
Usage like testing if 55 is in between 20 and 100:
I plan to use this in a Case Select structure.
Is there a function in B4A that you can pass in a number and the function returns true if the number is within a range?
Example:
B4X:
Sub fcnNumberInRange (intNumberIn as Int, intRangeStarting as Int, intRangeEnding as Int) As Boolean
' Code to determine if the passed in number is within the range.
If the number is in the range then
return true
else
return false
end if
End Sub
Usage like testing if 55 is in between 20 and 100:
B4X:
If fcnNumberInRange (55, 20, 100) then
' Do something here.
End If
I plan to use this in a Case Select structure.