Code to Evaluate a Single Expression

A single expression may be evaluated either directly against a Dictionary object containing a set of profiles or indirectly against a stored evaluation context. For information about evaluating the expression against a stored context, see Code to Evaluate Groups of Expressions.

  1. Using the ExpressionEval object, oExpressionEval, created in Code to Connect to the Expression Store, load the expression created in Code to Create a New Expression into the Expression Cache. The expression ID, lExpressionID, for this expression was retrieved in Code to Manipulate Expressions. Loading the expression is optional. If you have not preloaded the expression, the Eval method will load the expression upon execution.

    oExpressionEval.LoadExpr lExpressionID
    
  2. Evaluate the expression against the data contained in the dictProfiles context created in Code to Create an Evaluation Context.

    Dim vResult
    vResult = oExpressionEval.Eval(lExpressionID, dictProfiles)
    

The result of evaluating the expression, vResult, is True.


All rights reserved.