if

From RPTools Wiki
Revision as of 00:46, 2 December 2008 by Craig (talk | contribs) (New page: ==Function if== If testCondition evaluates to 0 then the result of falseExpr is returned, otherwise the result of trueExpr is returned. Note: '''both''' trueExpr and falseExpr are evaluate...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Function if

If testCondition evaluates to 0 then the result of falseExpr is returned, otherwise the result of trueExpr is returned. Note: both trueExpr and falseExpr are evaluated no matter what the result of testCondition is. You may want to consider using [if():] instead.

Usage

[h: result = if(testCondition, trueExpr, falseCondition)]


Examples

[r: if(a>b, "A is larger than B", "A is not larger than B")]