suve

awful: function: fork

Declaration

mixed :fork ( bool $CONDITION , mixed $TVAL , mixed $FVAL )

Summary

This function can be used as an equivalent of the ternary operator in C-like languages.

  1. If CONDITION is true, returns TVAL.
  2. If CONDITION is false, returns FVAL.

Example

# Compare two values.
:set &A &B i0
:read &A &B
:writeln s'A and B are ' (:fork (:eq $A $B) s'equal' s'unequal') s'.'

wikipage modified on 2014/0601/2317