Advertisement
Java_Volume1 Math/ Dates #102730

Calculate ( Calculator )

To provide a way for a program to use dynamic formulas / expressions at run-time. For instance you could read in a formula ( with variables ) from a config file then pass that formula ( variables and all ) to the Calculate Unit for processing. The Calculate unit will parse through the formula and preform the operations obeying all operator precedence rules ( Parenthesis, Power, Multiply, Divide, Modulus, Add, Subtract ). This allows for easy updates, should a formula definition change somewhere along the way. You can use the TStrings "memory" property to hold variables or formulas you want to use in your calculations. You may also override the OnFindVariableEvent to provide a custom way to search for variables ( i.e. from a database ). You could easily write your own Calculator application based on this Unit. Custom function processing has now been added to this very popular unit! Which means you can now write an Advanced Calculator with this unit or even your own spreadsheet application. Enjoy...

AI

AI Summary: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Source Code
original-source
Upload
Upload
Original Comments (3)
Recovered from Wayback Machine