I am making a Inductor Calculator that contains 12 Edit boxes and 5 Buttons. 5 for series calculation and an answer box. 5 for Parallel calculations and an answer box. The problem is if I use only say 3 of the 5 inputs I get an error that "" is not a valid floating point value. My code is like this for the series side.
and this for the parallel side..
The program works perfect if all the boxes are filled. Any suggestions are appreciated.
It can be seen at.. on the New Projects link.
Thanks,
Bob.![[pipe] [pipe] [pipe]](/data/assets/smilies/pipe.gif)
Code:
var
Form1: TForm1;
first: Real;
second: Real;
third: Real;
fourth: Real;
fifth: Real;
seventh: Real;
eighth: Real;
ninth: Real;
tenth: Real;
eleventh: Real;
answer: Real;
procedure TForm1.CalcsClick(Sender: TObject);
begin
first:=StrtoFloat(Edit1.Text);
second:=StrtoFloat(Edit2.Text);
third:=StrtoFloat(Edit3.Text);
fourth:=StrtoFloat(Edit4.Text);
fifth:=StrtoFloat(Edit5.Text);
Edit6.Text:=FloattoStr(first+second+third+fourth+fifth);
end;
Code:
procedure TForm1.CalcpClick(Sender: TObject);
begin
seventh:=StrtoFloat(Edit7.Text);
eighth:=StrtoFloat(Edit8.Text);
ninth:=StrtoFloat(Edit9.Text);
tenth:=StrtoFloat(Edit10.Text);
eleventh:=StrtoFloat(Edit11.Text);
Edit12.Text:=FloattoStr(1/(1/seventh+1/eighth+1/ninth+1/tenth+1/eleventh));
end;
It can be seen at.. on the New Projects link.
Thanks,
Bob.
![[pipe] [pipe] [pipe]](/data/assets/smilies/pipe.gif)