Expression Class

Namespace: Stimulsoft.Data.Expressions.NCalc

Constructors

Constructor Description
Expression(string expression)  
Expression(LogicalExpression expression)  
Expression(string expression, EvaluateOptions options)  
Expression(LogicalExpression expression, EvaluateOptions options)  

Expression(expression: string)

Parameters

  • expression (string)

Expression(expression: LogicalExpression)

Parameters


Expression(expression: string, options: EvaluateOptions)

Parameters


Expression(expression: LogicalExpression, options: EvaluateOptions)

Parameters

Properties

Property Type Description
Error string  
Options EvaluateOptions  
ParsedExpression LogicalExpression  

Methods

Method Returns Description
Compile static LogicalExpression  
Evaluate object  
HasErrors bool Pre-compiles the expression in order to check syntax errors. If errors are detected, the Error property contains the message.

Method Details

Compile static

Compile(expression: string, nocache: bool): LogicalExpression

Parameters

  • expression (string)
  • nocache (bool)

Returns LogicalExpression


Evaluate

Evaluate(): object

Returns object


HasErrors

HasErrors(): bool

Pre-compiles the expression in order to check syntax errors. If errors are detected, the Error property contains the message.

Returns bool — True if the expression syntax is correct, otherwiser False

Events

Event Type Description
EvaluateFunction EvaluateFunctionHandler  
EvaluateParameter EvaluateParameterHandler  

Fields

Field Type Description
OriginalExpression string Textual representation of the expression to evaluate.