Class TWPEvalEngine

Hierarchy

System.TObject | System.Classes.TPersistent | System.Classes.TComponent | WPEval.TWPCustomEvalEngine | TWPEvalEngine

Description for Class TWPCustomEvalEngine

The component TWPEvalEngine can be used to calculculate currency values in mail merge operation and also within text tables. To use it on tables you need to add the component TWPFormularInterface (unit WPTableCalc).
Esspecially the use in tables makes sense since you can here read out neighbour cells, i.e. add the VAT: "left(1)*1.19" would take the cell to the left and multiply it by 1.19.
You can also read out table cells by just using the name, i.e. "A". When you use "A" in a forumula it will be set equal to the sum of all cells with the name A.
In unit WPEval you will find the functions which are available, i.e. wpevSin() which is mapped to Sin().
There is also the unit WPDBEval which acts as interface to a dataset. It makes it possible to read out dataset fields and use in calculation. For this the dataset must be registered with the WPDBEvalEngine.
To register a data set with the TDBWPEvalEngine use DBWPEvalEngine.AddDataSet( Alias, Dataset)
The Alias will be expected before the . in a field name, i.e PRODUCTS.PRICE will read out the field price of the table products

Events

OnDBCommand : TWPExecuteDatabaseCommand= TWPExecuteDatabaseCommand

OnError : TWPEvalErrorEvent= TWPEvalErrorEvent

OnFunction : TWPReadFunctionResult= TWPReadFunctionResult

OnGetErrorMessage : TWPEvalGetErrorMessage= TWPEvalGetErrorMessage

OnProcessMessages : TNotifyEvent= procedure (Sender : TObject) of Object

OnReadVariable : TWPReadVariableValue= TWPReadVariableValue

OnWriteVariable : TWPWriteVariableValue= TWPWriteVariableValue

Used or referenced by

-Property TWPEvalType.Engine : TWPCustomEvalEngine
-Property TWPEvalType.Engine : TWPCustomEvalEngine