User Tools

Site Tools


syntax:functions:when

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

syntax:functions:when [2016/06/08 04:19] (current)
dmitry created
Line 1: Line 1:
 +====== when(condition, expression) ======
  
 +Returns the result of //expression// if //condition// is true. Otherwise returns [[syntax:types|empty value]]. This function is effectively a shorthand for '' if(condition, expression, empty()) ''
 +
 +^  Example  ^  Result  ^
 +| when( 2 + 2 = 4, 'Makes sense' | Makes sense  |
 +| when( 1 + 1 = 4, 'Makes sense' |   |
syntax/functions/when.txt · Last modified: 2016/06/08 04:19 by dmitry