User Tools

Site Tools


playground:playground

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
playground:playground [2021/09/12 23:44] craigtplayground:playground [2021/09/13 00:03] craigt
Line 1: Line 1:
-====== Coalesce(value1, value2…======+===== Empty() =====
 Category:  Special function Category:  Special function
  
 \\  \\ 
 =====Description===== =====Description=====
-This function returns the first value in the argument list that is //not// an [[syntax:types#empty_values|empty value]].+This function creates an [[syntax:types#empty_values|empty value]].
  
 \\  \\ 
-=====Alternate formats===== +=====Use cases===== 
-This function can take from 2 to values as arguments. +Use //empty()// to insert empty values into cells, or within other functions.
-  coalesce(value1, value2, value3, value4, value5, value6)+
  
 \\  \\ 
 =====Arguments===== =====Arguments=====
-^Argument^Type^Description^ +This function does not require arguments.
-|valueN|Any|A value tested to determine whether it represents an //empty value// or not.|+
  
-**Return value type:** Any (The type of the returned, non-empty value.)+**Return value type:** Empty value
  
 \\  \\ 
 =====Remarks===== =====Remarks=====
-To use the function with more than 6 arguments, nest function callsKeep in mind that arguments are evaluated before a function is evaluated. +While a value can be tested for an empty value using a "value = empty()" expression, the [[syntax:functions:isempty|IsEmpty]] function can also be used The two approaches are equivalent.
- +
-If all arguments are empty values, an empty value is returned.+
  
 \\  \\ 
 =====Examples===== =====Examples=====
-  coalesce(empty(), 'ABC', '' //Returns 'ABC' 
  
-  coalesce(empty(), '', 'ABC')  //Returns '' (Empty text value but not an empty value.)+  [Content] = empty()  //Returns TRUE if [Content] contains an empty value, otherwise, FALSE.
  
-  coalesce(empty(),empty())  //Returns an empty value  (All arguments are empty values.)+  coalesce(empty(), 'ABC', '' //Using empty() as an argument within a function. 
 + 
 +  if( [Value] = 10, 'Ten', empty() )  //Using empty() to set an empty value in an If statement.
  
-  coalesce(empty(), coalesce('ABC',empty()) ,'XYZ' //Returns 'ABC'  (Nested functions) 
  
 \\  \\ 
 =====See also===== =====See also=====
-  * [[syntax:functions:empty|Empty()]] +  * [[syntax:functions:isempty|IsEmpty(expression)]] 
-  * [[syntax:functions:pick|Pick(index, values, separator)]]+  * [[syntax:types|The EasyMorph Type system]] 
 + 
  
playground/playground.txt · Last modified: 2024/04/11 21:06 by craigt

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki