Ifelse statements in expression


#1

Is there any way of writing ifelse statements in expressions? Or even an if statement?


#2

Ternary operator - (Condition ? True : False)

Example:

(([living room light : switch])==on?”the switch is on”:”the switch is off)


#3

And you can stack a ternary operator inside a ternary operator etc etc.

(count(PersonsPresent)==0 ? ”everyone is away” : (count(PersonsPresent)==1 ? PersonsPresent “ is present” : PersonsPresent “ are present” ))


#4

I think that is exactly what I was looking for, stacking them into eachother. Thank you!