Question
David Crawford · Jun 5, 2018

Ternary Operators

Hello community, simple question. I've been able to use a ternary operator equivalent by using $select for inline if statements using this pattern:

set x = 1

set result = $select(x = 1: "true", x = 0: "false")

These can be nested and can have a lot of options. But I'm curious if there is a native way of using ternary operators in ObjectScript?

Thank you

0
0 942
Discussion (1)2
Log in or sign up to continue

There is no direct equivalent in ObjectScript to the ternary operator. You can use $SELECT or $CASE