Does anyone know which predefined functions (e.g ABS function) are included in the TEvaluator JCL class for Delphi 7?
Does anyone know which predefined functions (e.g ABS function) are included in the TEvaluator
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There are none of the standard functions from
Math.pasincluded. All that is implemented in the default evaluation parser are the operatorsor,xor,and,not,mod,+,-,/,*,<,>,<=,>=,=,div,cmp,bor,bxor,band,bnot,shl, andshr. (As many as I found in a quick check of the source, and a few I missed based on @David’s comment.)You can add functions (including those that are part of the Delphi RTL) to the evaluator fairly easily. It’s even shown in the demo, which adds the functions from one of the JCL units.
The JCL evaluator example (ExprEvalExample.dpr) found by default in the
JCL\examples\common\exprevalfolder passes aTComboBox.Itemsto theInitfunction inExprEvalExampleLogic.pasas theFuncListparameter, which is populated by this code (theTEasyEvaluatoris given the functions in the same routine) with the functions fromJclMath.pas:Those would be the functions supported in the demo app. You can add your own in a similar fashion.