Expression.ValidateEvaluationType
- Aktualisiert2025-07-21
- 2 Minute(n) Lesezeit
Expression.ValidateEvaluationType
Syntax
Expression.ValidateEvaluationType( validEvaluationTypes, additionalConstants, evaluationContext, evaluationOptions, errMsg, errorStartIndex, errorEndIndex)
Return Value
Purpose
Checks that the expression evaluates to a specified type and returns error information if the expression does not.
Remarks
This method returns TS_Err_NoError if the expression evaluates to a type the validEvaluationTypes parameter specifies. This method returns the corresponding TSError if the expression has a syntax or evaluation error. This method returns TS_Err_UnexpectedType if the expression evaluates without an error, but does not evaluate to a type the validEvaluationTypes parameter specifies.
Parameters
validEvaluationTypes As EvaluationTypes
[In] Specifies the type(s) to which you expect the expression to evaluate.
additionalConstants As Object Array
[In] Specifies additional variables the expression might contain that are not part of the evaluationContext . This parameter is useful if the expression can contain a constant from an enumeration, such as a parameter value of a module call when the parameter type is an enumeration. You can pass NULL for this parameter if there are no additional constants you want to use when evaluating the expression.
evaluationContext As PropertyObject
[In] Specifies the context in which to evaluate the expression. This method uses this object to locate variables the expression specifies.
evaluationOptions As Long
[In] Specifies any combination of the EvaluationOptions constants. It is not necessary to pass the EvalOption_DoNotAlterValues constant because this method never alters values.
errMsg As String
[Out] If the expression does not evaluate to the specified type, this parameter returns a description of the error.
errorStartIndex As Long
[Out] If the expression does not evaluate to the specified type, this parameter returns the character index of the start of the invalid portion of the expression.
errorEndIndex As Long
[Out] If the expression does not evaluate to the specified type, this parameter returns the character index of the end of the invalid portion of the expression.