/>
void __ fastcall TForm1 :: N2Click (TObject * Sender)
{
Bool ();
Form3-> Show ();
SB1-> SimpleText = "Зроблено розрахунок ";
}
// --------------------------------------------- ------------------------------
Unit2.cpp
В
// --------------------------------------------- ------------------------------
# include
# include
# pragma hdrstop
# include "Unit2.h"
// --------------------------------------------- ------------------------------
# pragma package (smart_init)
# pragma link "ibctrls"
# pragma link "ibreg"
# pragma link "CSPIN"
# pragma resource "*. dfm"
TForm2 * Form2;
extern float a, b, e;
// --------------------------------------------- ------------------------------
__fastcall TForm2 :: TForm2 (TComponent * Owner)
: TForm (Owner)
{
}
// ------------------------------------------
// --------------------------------------------- ------------------------------
void __ fastcall TForm2 :: Button2Click (TObject * Sender)
{
Form2-> Close ();
}
// --------------------------------------------- ------------------------------
float __ fastcall TForm2 :: checkf (TObject * Sender, TEdit * E1, float w)
{
float buf;
do {
try
{
if (e1-> Text! = "")
buf = StrToFloat (e1-> Text); else buf = w;
}
catch (const EConvertError & e)
{
int j = Application-> MessageBox ("Невірні дані", NULL, MB_OK);
buf = -1;
e1-> Text = FloatToStr (w);
}} while ((buf == -1));
return buf;
}
// ----------------------------------------
void __ fastcall TForm2 :: Button1Click (TObject * Sender)
{
e = checkf (Sender, Edit4, e);
a = checkf (Sender, Edit1, a);
b = checkf (Sender, Edit2, b);
Form2-> Close ();
}
// --------------------------------------------- ------------------------------
void __ fastcall TForm2 :: FormCreate (TObject * Sender)
{
Edit1-> Text = FloatToStr (a);
Edit2-> Text = FloatToStr (b);
Edit4-> Text = FloatToStr (e);
}
// --------------------------------------------- ------------------------------
void __ fastcall TForm2 :: GroupBox1Click (TObject * Sender)
{
}
// --------------------------------------------- ------------------------------
В
Unit3.cpp
В
// --------------------------------------------- ------------------------------
# include
# pragma hdrstop
# include "U...