IFF

IFF (condition, return_value_true, return_value_false)

Inline version of IF.

Example 1

animal = "cat"
fur = IFF( animal == "cat", "yes", "no")
print fur

Example 2

Eq = "sin"
x = 5

ans = iff(Eq == "sin", sin(x), cos(x))
print ans

' Alternative syntax:

if(Eq == "sin") then
    ans = sin(x)
else
    ans = cos(x)
endif

print ans

Example 3

x = 4

ans = iff(x <= 5, 0, 10)
print ans 
Language
If there is insufficient information on this page and you wish learn more about IFF, please send an email to smallbasic@gmail.com. You can help to improve information about IFF by submitting a pull request, click View Source for details. Note, an offline language reference text file is also available - see the Download section.