You are here: Symbol Reference > MtxParseExpr Namespace > Classes > TMtxExpression Class > public > DefineFunction Method > TMtxExpression.DefineFunction Method (string, TExprFunc, Integer, Integer, string)
MtxVec VCL
ContentsIndex
Example

Add factorial function to the function list.

procedure _Factorial_D (Param: TExprRec) begin Param.Res.DefineDouble; Param.Res.DoubleValue:= Fact(Round(Param.Args[0].DoubleValue)); end; procedure Example(MyParser: TMtxExpression); begin myParser.DefineFunction('fact_double', _Factorial_D, 1, 'fact_double(x): factorial function'); end;
Copyright (c) 1999-2025 by Dew Research. All rights reserved.