| Applying science to business management |
  
Conditional
Format: x ? y : z
Arguments: (bool) x Any Boolean expression
[any] y Consequent if x is true
[any] z Consequent if x is false
Returns: [any] The value of y if x is true,
else the value of z
Description: This operator implements an
if...then...else construct. First, x is evaluated and if
it is true (returns a non-zero numeric value), the
expression y is evaluated and its result is returned.
Otherwise, the expression z is evaluated and its value is
returned. Under no circumstances will both y and z
be evaluated.
Examples: true?1:0 = 1
false?2+3:4+6 = 10
3>8||6<=7?"true
value":"false value" = true value
See Also: if, switch, true, false
|