syntax:functions:if
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| syntax:functions:if [2016/06/08 00:14] – dmitry | syntax:functions:if [2021/08/16 02:42] (current) – [Examples] craigt | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== If(condition, | + | ====== If(condition, |
| + | Category: | ||
| - | Returns the result of //expression1// if //condition// is true. Otherwise returns the result of //expression2//. | + | \\ |
| + | =====Description===== | ||
| + | This function evaluates | ||
| - | ^ | + | \\ |
| - | | if( 2 + 2 = 4, 'Makes sense', | + | =====Arguments===== |
| - | | if( 2 + 1 = 4, 'Makes sense', | + | ^Argument^Type^Description^ |
| + | |condition|Expression|This is an expression or " | ||
| + | |when_true|Expression|If the // | ||
| + | |when_false|Expression|If the // | ||
| + | **Return value type:** Text, Number, Boolean (the value types used for // | ||
| + | \\ | ||
| + | =====Remarks===== | ||
| + | To return a Boolean TRUE or FALSE value, use the [[syntax: | ||
| + | |||
| + | If() functions can be nested to provide decisions based on more than a single test, and return a value from more than just two choices. | ||
| + | |||
| + | Both // | ||
| + | |||
| + | \\ | ||
| + | =====Examples===== | ||
| + | |||
| + | if(2+2=4, "Yes it does", "No it doesn' | ||
| + | |||
| + | if(" | ||
| + | |||
| + | if(rem(4, | ||
| + | |||
| + | if({MyVal}+6=8," | ||
| + | |||
| + | \\ | ||
| + | ====Nested if()s==== | ||
| + | Another " | ||
| + | |||
| + | if( [Field1)> | ||
| + | |||
| + | If [Field1] is greater than 10, the condition is evaluated to TRUE and the // | ||
| + | |||
| + | Nested if()s can be used for the // | ||
| + | |||
| + | \\ | ||
| + | ===== See also ===== | ||
| + | * [[syntax: | ||
| + | * [[syntax: | ||
| + | * [[syntax: | ||
| + | * [[syntax: | ||
syntax/functions/if.1465359292.txt.gz · Last modified: by dmitry