combit List & Label 25 - .NET Online Web Help
Evaluate Method


combit.ListLabel25 Namespace > ExpressionEvaluator Class : Evaluate Method

The formula for evaluating.

The formula is passed to the Evaluate method, which returns the result as an object. Now, you can carry out an easy type conversion according to the data type. The sample listing shows how to call the class. The current date is passed as a variable. List & Label.s designer function, AddWeeks, adds two weeks to this date. The result is displayed in a MessageBox.

Syntax
'Declaration
 
Public Function Evaluate( _
   ByVal expression As String _
) As Object
public object Evaluate( 
   string expression
)
public:
Object^ Evaluate( 
   String^ expression
) 

Parameters

expression

The formula for evaluating.

Example
ExpressionEvaluator eval = new ExpressionEvaluator();

eval.Variables.Add("date", DateTime.Now);

DateTime newDate = (DateTime) eval.Evaluate("AddWeeks(date, 2)");

MessageBox.Show(newDate.ToString());

Requirements

Platforms: Windows 7 SP1 - Windows 10 Version 1909, Windows Server 2008 R2 - 2019

See Also

Reference

ExpressionEvaluator Class
ExpressionEvaluator Members