------------------------------------------- Advanced Calculator v5.22 for Delphi 4/5/6/7 Copyright 1999-2003 by Qarsoft All rights reserved http://www.qarsoft.com info@qarsoft.com ------------------------------------------- Requires the components Dynamic List v1.33 and Text Reader v3.01 or later versions. A fast run-time expression evaluator working on 5 type. 1. Features - 5 base type - Integer, Extended, Boolean, String, DateTime; - Arithmetic operators ( +, -, *, /, Div, Mod, ^ ); - Comparison operators ( >, <, =, <>, >=, <= ) for all types; - Logical operators for boolean types (And, Or, Xor); - Recognition of expression's type; - Multilevel If - Then - Else statement; - 47 build in functions; - Unlimited amount of On-Event evaluated functions and variables; - Unlimited amount of run-time defined functions and variables; - Declaration of functions with or without parameters; - Using field names of dataset as variables; - Pseudo compilation of text for fast repeated evaluation; - Scientific floating point notations ( 1.2e-3 ); - Full error handling; - Comments in a text of expression; - Customizable String/Comment signs; - Denotation of two StringSignes in string as one sign; - String constant with DateTime format as DateTime constant; - Multilevel calling of subexpressions in evaluated On-Events; - Saving library of variables and functions in a file; - Initialization of variables using expressions in one text box; - Links between variables of application and run-time variables of component; - High speed (12 000 - 60 000 evaluations per sec. on 2ghz CPU); - Full help and demo. The "And", "Or" and "Xor" operators can be used only for values of Boolean type, Therefore their priority less than priority of comparison symbols. For example: expression 10>3 and 5>3 uniformly with expression (10>3) and (5>3). 2. Predefined functions Functions of Integer type: DayOfWeek, Pos, Length, Round, StrToInt. Functions of Extended and Real type: Iff, Frac, Int, Exp, Log, Ln, Sin, Cos, ArcSin, ArcCos, Sinh, Cosh, ArcSinh, ArcCosh, Tan, CoTan, ArcTan, Tanh, ArcTanh, Sqr, Sqrt, Abs, StrToFloat. Function of Boolean type: Not, IsLeapYear. Functions of String type: LowerCase, AnsiLowerCase, UpperCase, AnsiApperCase, Copy, IntToStr, FloatToStr, DateTimeToStr, TimeToStr, DateToStr, FormatDateTime. Functions of DateTime (TDateTime) type: EncodeDate, EncodeTime, IncMonth, StrToDate, StrToDateTime, StrToTime. Ranges of these functions in full likeness with the same name functions of Delphi. 3. Error Codes and Descriptions 0. No error; 1. Integer type value expected; 2. Integer, Extended or DateTime type value expected; 3. Boolean type value expected; 4. String type value expected; 5. DateTime type value expected; 6. "+", "-", "*", "Div" or "Mod" expected; (for integer type) 7. "+", "-", "*", "/" or "^" expected; (for Extended and DateTime types) 8. "AND", "OR" or "XOR" expected; (for boolean type) 9. "+" expected; (for string type) 10. Comparison sign expected; 11. "(" expected; 12. ")" expected; 13. "," expected; 14. Division by zero; 15. Number of parameter is out of range; 16. Variable name expected; 17. "=" expected; 18. ";" or "." expected; 19. "." expected; 20. "Then" expected; 21. "Else" expected; 22. Invalid Integer; 23. Invalid Floating Point Number; 24. Invalid Date; 25. Invalid Time; 26. Invalid Date and Time; 27. String sign expected. 4. Installation Copy the following files in your AdCalc directory 1) AdCReg.pas 2) AdCReg.dcr 3) AdCalc.pas or AdCalc.dcu 4) AdCMsg.pas This component requires components: Dynamic List v1.33 and Text Reader v3.01, but if You do not require this components separately, You can only copy the following units in your AdCalc directory: 1) DList.pas or DList.dcu; 2) Reader.pas or Reader.dcu. Then install component AdCalc - Component / Install Component / Browse / AdCReg.pas / Ok / Compile. Make sure that path of your AdCalc directory is indicated in - Tools / Environment Options / Library / Library path. 5. History v3.01 In the event OnError and procedures GetExtendedResult and GetBooleanResult is added the parameter "Handle", which specifies the expression, where error was occured. 3.02 Is added error code 11 - "The parameter is out of range". This error arises when calling of formal parameter of run-time function, where number of parameter is out of range. v3.1 Evaluation of text box of expressions, assigning values of unlimited amount of variables; accordingly additional error messages. v3.2 Connections between variables of application and run-time variables of AdCalc; Comments in a text of expression; Descriptions for variables and functions. v4.0 Acceleration of cyclic evaluations by preliminary pseudo compilation of expression. v4.1 Is added the new base type - STRING. v5.0 Is added two base types - Integer and DateTime; Component has become to use units DList and Reader and evaluation has become faster on 50%. v5.1 Multilevel If - Then - Else statement. v5.11 Declaration of run-time functions without parameters. v5.12 Fixing of some bugs; Additional codes of error handling. v5.13 Case sensitivity for Displaying names of variables and functions. v5.14 Acceleration of evaluation of predefined functions on 30%. v5.15 New properties: CommentSign, StringSign, CaseSensitivity; Denotation of two StringSignes in string as one sign. v5.16 Is added the parameter UserText in the methods of variables and functions for storing any text data and the parameter Active in the methods of functions for their activation or deactivation; The parameters are added in the following events and methods: events like - OnGetXFunct and OnGetXVar, OnFunctList, OnVarList; methods - DefineFunction, RegFunction, RegVariable,GetVarProperties, GetFunctProperties; The following methods are added: SetFunctActive, GetFunctActive, SetVarUserText, GetVarUserText, SetFunctUserText, GetFunctUserText; Is added the parameter Handle in the events like - OnGetXFunct and OnGetXVar for definition of expression's handle; A bug is fixed. v5.2 Recognition of expression's type. v5.21 New property DataSet for Using field names of dataset as variables. v5.22 String constant with DateTime format ("02.08.03 18:00") can use as DateTime constant instead of using StrToDateTime function; Description of Error Code 2 has become "Integer, Extended or DateTime type value expected" instead "Extended type value expected".