Conditional operator

Top  Previous  Next

Scripts > Class elements and c++ instructions > Interpreted C++ instructions > Operators > Conditional operator




logical-OR-expr ? expr : conditional-expr




The conditional operator ?: is a ternary operator.

In the expression E1 ? E2 : E3, E1 evaluates first. If its value is true, then E2 evaluates and E3 is ignored. If E1 evaluates to false, then E3 evaluates and E2 is ignored.

The result of E1 ? E2 : E3 will be the value of either E2 or E3 depending upon which evaluates.



The condition operator only is in the TETRA interpreter of a very restricted use since for the E's not the full spectrum of c++ expressions is permitted at present. You can get more exact information about this by looking into the parser for the TETRA c++-interpreter.

This page belongs to the TextTransformer Documentation

Home  Content  German