TMtxExpression.Test Method

Overload List

#SignatureDescription
1procedure Test(const anExpr: string; ResultValue: TCplx; AllowNanInf: Boolean);Specifies a single expression, which must match ResultValue, underwise an exception is raised.
2procedure Test(const anExpr: string; ResultValue: Double; AllowNanInf: Boolean);Specifies a single expression, which must match ResultValue, underwise an exception is raised.

Overload 1: procedure Test(const anExpr: string; ResultValue: TCplx; AllowNanInf: Boolean);

Specifies a single expression, which must match ResultValue, underwise an exception is raised.

#NameTypeDescription
1anExprstring
2ResultValueTCplxscalar
3AllowNanInfBoolean

Result: stored in self (calling object)

Overload 2: procedure Test(const anExpr: string; ResultValue: Double; AllowNanInf: Boolean);

Specifies a single expression, which must match ResultValue, underwise an exception is raised.

#NameTypeDescription
1anExprstring
2ResultValueDoublescalar
3AllowNanInfBoolean

Result: stored in self (calling object)

Examples
procedure TestAddOperator(aParser: TMtxExpression);
begin
    aParser.Test('1+2',3); //no exception will be raised, if result is a match
end;