User Tools

Site Tools



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

Link to this comparison view

Both sides previous revision Previous revision
syntax:functions:eval [2020/07/09 17:16]
syntax:functions:eval [2021/09/13 21:03] (current)
Line 1: Line 1:
-===== Eval(text) =====+====== Eval(text_expression) =====
 +Category:  Special function
-Evaluates the text argument as an EasyMorph expression. The argument itself must not be +\\  
-an expression with a reference to column.+=====Description===== 
 +This function evaluates the //text_expression// argument as an EasyMorph expression. 
 +=====Use cases===== 
 +This function makes it possible to define EasyMorph expressions externally using parameters.
-    eval('1+1'          //Result is 2.+\\  
 +|text_expression|Text|An expression in text format to be evaluated.| 
 +**Return value type:** Any (The type of the expression output)  
 +The argument itself must not be an expression with a reference to column. 
 +    eval('1+1' //Returns 2
-    eval('1' & '+1'     //Result is 2.+    eval('1' & '+1' //Returns 2
-    eval('max(1,2)'     //Result is 2.+    eval('max(1,2)' //Returns 2
-    eval('[Count]+1'    //Evaluated as [Count]+1.+    eval('[Count]+1' //Evaluated as [Count]+1
-    eval([Count] & '+1' //Invalid! References to columns are not allowed in argument expressions.+    eval([Count] & '+1' //Invalid! Column references are not allowed in argument expressions.
-    eval({Param1})        //If the value of {Param1} is '[Count]+1' then it's evaluated as [Count]+1. Parameter references are allowed.+    eval({Param1})  //Parameter references to expressions in text format are allowed.
-    eval("1+" & "eval('1+1')") //Result is 3Nesting eval() is allowed.  +    eval("1+" & "eval('1+1')" //Returns  (Nesting eval() is allowed.)
- +
-The eval(function makes it possible to define EasyMorph expressions externally using parameters.+
syntax/functions/eval.txt · Last modified: 2021/09/13 21:03 by craigt