Цитата:
Сообщение от MiraLaklamon
Код:
if edit2.Text<>'' then
begin
a := StrToFloat(edit1.Text);
b := StrToFloat(edit2.Text);
c := a*b ;
end;
if edit4.Text<>'' then
begin
a := StrToFloat(edit3.Text);
b := StrToFloat(edit4.Text);
c := c + a*b ;
end;
if edit6.Text<>'' then
begin
a := StrToFloat(edit5.Text);
b := StrToFloat(edit6.Text);
c := c + a*b ;
end;
lbl1.Caption := FloatToStr(c);
|
что то не работает написал вот как
Код:
{$R *.dfm}
с:= 0 ;
if edt2.text<>'' then
begin
a := StrToFloat(edt1.Text);
b := StrToFloat(edt2.Text);
c := a*b ;
end;
lbl1.Caption := FloatToStr(c);
Код:
[Error] Unit1.pas(33): Declaration expected but 'IF' found
[Error] Unit1.pas(35): Undeclared identifier: 'edt1'
[Error] Unit1.pas(36): Missing operator or semicolon
[Error] Unit1.pas(36): Undeclared identifier: 'edt2'
[Error] Unit1.pas(37): Missing operator or semicolon
[Error] Unit1.pas(38): '.' expected but ';' found
[Fatal Error] Project1.dpr(5): Could not compile used unit 'Unit1.pas'