Syntax for if expression for string fields

Touch Help for Expressions says:
if ($F<12, $F, 75)

For if expression usage in string value fields i am trying:
if (constant1/chan1==0 , zero , not_zero)

I am not sure what the syntax should be for this… also how can I use “if else” expression? Thanks!

Hey Leo,

The ‘if’ expression can only output numbers. You’ll want to use ‘ifs’ if you want your true/false output values to be strings.
Along with this, the expression “constant1/chan1” == 0 will always be false. This expression is just comparing the string “constant1/chan1” to 0, which will always be false ofcourse. You want to get the channel value from constant/chan1 I assume right? You can use the ‘chop’ expression for this.
So your statement would be

ifs (chop("constant1/chan1") == 0, "zero", "not_zero")

Hope that helps.