for anyone interested here's the source of my calculator
What is this parameter that is not described? (it is located at the top of the 2nd column, it has no label, I marked it in the screenshot)
EDIT: OK. I found the answer in the source code (i.e. the parameter may be different depending on the selected radio button option).
I also had some observations. I would change the names of the controls (labels, edit fields, buttons and radio buttons) and variables to more descriptive ones. The numbers do not say anything (e.g.:
Edit1, good practice says that the code should be self-describing, e.g.:
EditLightWeight). In addition, the name of the main window (
TMudCalc) could also be more intuitive (e.g.
TMudCalcForm, or even better, simply
TMainForm).
The code contains these instructions like:
if RadioButton2.Checked = True
then
You do not need to compare the control state with a boolean value. Just:
if RadioButton2.Checked
then
There are also some repetitive texts. You can simplify the code by using text constants, e.g.:
SLabelCarbonate = 'Carbonate';
The code in the
OnKeyDown event handler of several edit fields is also copied multiple times. You can create one procedure, which will then be assigned to the events of many controls (edit fields).
The code that zeros (empty string) the text of 4 text fields can also be simplified by creating a procedure that iterates over the edit fields and assigns them an empty string. This procedure would then be called when you need to zero the edit fields.