Eval library | Eval - defined functions | Unit EvalDefs |
COMPONENT | DESCRIPTION |
TEval | basic component, which includes substance able to provide analysis and summarizing of terms |
TEvalList | able to apply for a group of terms, it is suitable when applying more cells into one data table |
TEvalDBNavigator | wide-spread TDBNavigator which provides movement all around the suitable records |
TEvalFnPanel | user's database of terms and conditions. It consists of list box with many function groups and after entering the group there will be a list of functions displayed |
TEvalParams | provides editation of parameters of the entered function, provides re-entering the function after becoming parameter itself |
TEvalHistory | combo box is used when re-opening the old terms and conditions or when re-using them |
TEvalFnGroupCombo TEvalFnGroupList | used when choosing groups of functions (string functions, numeric functions, ...) |
TEvalFnListBox | used when choosing the concrete function of the list |
UNITS | |
Eval | basic unit, the seat of the library EVAL and its TEval component |
EvalDefs | working with the list of functions, exporting this list into HTML |
EvalRes | consists of descriptions of functions, titles of windows, ... When localization of EVAL libraries into home language is needed, it is enough to modify texts in this unit and then you should recompile the library |
EvalCom | consists of components which are based on the combo boxes and list boxes (TEvalFnGroupList, TEvalFnGroupCombo, TEvalFnListBox, TEvalTEvalHistory) |
EvalPar | component called TEvalParam - provides setting up the user's parameters of chosen function |
EvalSub | Form TSubFunctionFmt which provides applying for completed function
by parameters and each parameter can be a function again - in this case
it will be automatically re-called. The result is TSubFunctionFmt.Expression.
function DialogExpression(_Level:Integer; _DataSet:TDataSet):String - provides applying for completed function by using the TSubFunctionFmt form. |
EvalReg | provides registration of all the Eval components |
EvalNav | component of TEvalDBNavigator |
EvalExPanel | component of TEvalFnPanel - used when choosing a function from the list of functions, also gives a description of the function and parameters |
EvalFn | additional functions which are not situated in Delphi. They are used in order to make the Eval library larger. |
Evalist | component of TEvalList. |
TEval |
---|
|
WORKING WITH THE INTERN CHANGEABLE TERMS.
They are used to simplify and accelerate working with TEval. When summarizing of one single term with many changeable terms /which are almost constant/ is needed, you should use these changeable terms. Example : you need to calculate sin / DegToRad / x// for x from 0 to 360. If you used the function Expression := 'Sin/../, Evaluate,.... you would make the calculation slower. Therefore we use changeable terms. This term will be X and then we make a calculation. var i:Integer; y:Double; begin EVAL.AddVariable('X',0); EVAL.Expression:='Sin(DegToRad(X))'; for i:=0 to 359 do begin EVAL.SetValue('X',i); y:=EVAL.AsFloat; end; end;
|
it creates the position of function RecordCount. If the table is large, the operation can last longer, therefore it would be suitable to show some kind of index. That is possible in OnProgress. The value of Position is given in percents. |
Expr - how to calculate the value of the field |
|
property AsDateTime : TDateTime property AsFloat : Double property AsInteger : Integer property AsString : string property AsVariant : Variant property Value : Variant |
|
Example for calling : Integral ( 'X*X','X',1,2,1000). |
Examples - terms Sin ( RadToDeg ( Alfa)) Copy ( Name ,2,4) + Left ( City , 5) Examples - conditions ID > 100 and Copy ( Name ,1,3) = 'SVK' Between (ID ,1 ,100) |
|
|
|
|
|
TEvalList |
It is the same as TEval but it contains the list of terms. It can summarize more terms for one dataset. It is more advantageous than working with TEval components. It contains also methods for manipulation with field of terms. There is one TEval component for each term in the field. They have just common dataset. |
|
|
|
|
|
|
|
For example when:
EvalList.CreateCalcField ( 'CF1', TStringField, 20,' Copy ( CITY, 1,3)+''-''+ State'); In this case, the Fields [0] and Fields [2] nil, Fields [1] will be in function of TField. |
|
property ForceString : Boolean property DataSet : TDataSet |
TEvalDBNavigator |
TDBNavigator (extended TDBNavigator) is really easy component useful when filtering the records. |
|
|
TEvalFnPanel |
It provides choosing the function from the list of functions. On the
left side there is a list box with a list of the groups of functions according
to their description. On the right side there would be the functions of
chosen group shown. It is also possible to show the description of the
function. It is allowed to use the component simultaneously with the TEvalParams
components in order to gain total term with all the parameter's.
|
TEvalParams |
Component includes one TEdit which displays the term. It also includes max. 6 combo boxes which are used by the users in order to give some parameter's. There is always one button in front of the combo box and it is used in order to give some sub terms. Level : Integer; var Dialog : Boolean) of object; It is an event called when using the sub function/entering the button on the left side of the parameter's field/. The user is also allowed to click the value of Dialogue on FALSE which means that there will be no sub function's window displayed. It is suitable when the user wants to simplify the term. Example of component TEvalParams : |
|
TEvalHistory |
Component providing a quick choice from the group of saved terms and
conditions. Term or condition could have their own name which will be displayed
in user's combo box. Program is able to give a description of the event
in OnChange. The qualities of Eval can be set up by its components. The
terms are saved in the file called FileName. There can be many terms in
one file, even if they are of various types or they are used in various
datasets. Quality called FileNameKey is used to separate the terms according
to the applied conditions.
|
TEvalFnGroupCombo, TEvalFnGroupList |
These are components used to choose group of functions, it is usual combo box which contains also predefined name of the group. The only strange quality is property FunctionType : TFnType. This quality enters the chosen group of functions. To join with another components the user should use event OnChange. See also EvalDefs |
|
TEvalFnComboBox, TEvalFnListBox |
These are components used to choose a concrete function. It is usual
combo box, actually list box with predefined names of the functions.
Properties : property FunctionType : TFnType - enters chosen function type property SelectedFunction : TEvalSymbol - the just chosen function To join with other components the user should use event OnChange.
|
procedure TForm2.FILTER_GRDrawColumnCell ( Sender: TObject; const Rect: TRect; DataCol: Integer; Column: TColumn; State: TGridDrawState); begin if (EVAL_FILTER.Expression<>'') and (EVAL_FILTER.AsBoolean) then GRID.Canvas.Brush.Color := clYellow; GRID.DefaultDrawColumnCell ( Rect, DataCol, Column, State); end;
It contains a defining field of groups of functions with their names,
description of their parameter's and their separation according to their
qualities. It contains also a few types, functions and procedures which
are used to work with the list of functions. It is not allowed to add a
function to this list straight ahead. when adding a function, a lot of
operations described in the following part should be done.
Working with the list of groups of functions. | ||
---|---|---|
TFnType | fnOperators | logical operations |
fnString | String operations | |
fnNumber | functions with numbers | |
fnDate | Functions with date & time | |
fnGonio | Goniometric & Geometric | |
fnFinancial | Functions working with money | |
fnConversion | Conversional functions | |
fnFile | Functions working with files and their names | |
fnMisc | various functions that can not be added anywhere else | |
fnAll | all the functions, used by procedures and to apply for all the functions short version - fnOperators, fnGonio ... | |
fnNone | no function | |
TFnTypes | Set of TFnType | |
procedure GetFunctionGroup ( L : TStrings); | It fills the list L by kist of groups of functions. L.Strings contains the names /titles/ of groups and L | |
function GetFunctionGroupName ( T : TFnType ) : String; | It gives back the name if the group of functions according to the identification. |
LISTS OF FUNCTIONS AND THEIR USE. | ||
---|---|---|
TEvalSymbol | Function's identification which is used straight for the gist of Eval library in order to identification the just worked on function. The list of functions is dependent on the version of the library. See List of Functions. | |
TDefFun | This record is used when working with functions. The user
is not allowed to use it straight, just by defined functions.
TDefFun = Record Name : String; // function's name Params : ParamString; // parameter's list Kind : TFnType; // function's group FT : TEvalSymbol; // id of function Hint : String; // description of function ParHint : String; // parameter's description with separator '|' End; |
|
|
||
EXPORT OF THE LIST OF FUNCTIONS TO THE HTML FORMAT. | ||
---|---|---|
type TEvalHtml | ||
fnEvalHtmlTable | name and description of the function in the table format | |
fnEvalHtmlTableWithCall | description of function and parameters in table format | |
fnEvalHtmlList | export of the list in numerous format | |
fnEvalHtmlText | export in the usual text's format |