User Tools

Site Tools


syntax:functions:eval

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
syntax:functions:eval [2020/07/08 18:03] dmitrysyntax:functions:eval [2021/09/13 21:03] craigt
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. 
  
-Examples:+\\  
 +=====Use cases===== 
 +This function makes it possible to define EasyMorph expressions externally using parameters.
  
-    eval('1+1'          //Result is 2.+\\  
 +=====Arguments===== 
 +^Argument^Type^Description^ 
 +|text_expression|Text|An expression in text format to be evaluated.| 
 + 
 +**Return value type:** Any (The type of the expression output)  
 + 
 +\\  
 +=====Remarks===== 
 +The argument itself must not be an expression with a reference to column. 
 + 
 +\\  
 +=====Examples===== 
 +    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. 
- +     
-The eval() function makes it possible to define EasyMorph expressions externally using parameters.+    eval("1+" & "eval('1+1')" //Returns 3  (Nesting eval() is allowed.)
syntax/functions/eval.txt · Last modified: 2023/05/16 15:02 by dmitry

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki