.


:




:

































 

 

 

 


3.




: Y:= A/(5-X);

LabeledEdit1 A;

LabeledEdit2 X;

LabeledEdit3 Y;

TForm1.LabeledEdit1KeyPress(Sender: TObject; var Key: Char) A, 1 2;

TForm1.LabeledEdit2KeyPress(Sender: TObject; var Key: Char) X;

: , Y ( OnKeyPress).

 

TButton OnKeyPress, 1 Object TreeViewButton1 1Object Inspector ÌEvents OnKeyPress, interface Button1Click(Sender: TObject).

implementation .

 

, , .

procedure TForm1.Button1Click(Sender: TObject);

Var A, X, Y: Real; //

Begin

{ }

A:= StrToFloat(LabeledEdit1.Text);

X:= StrToFloat(LabeledEdit2.Text);

Y:= A/(5-X); // Y

{ Y LabeledEdit3}

LabeledEdit3.Text:=FloatToStr(Y);

End;

.

:

;

=5

ShowMessage

ShowMessage(const Msg: string) - OK, .

Msg -

.

4.

: , Y:= A/(5-X), . 3.

: , TForm1.Button1Click , 0 =5.

 

, , .

 

!
True
. 0 procedure TForm1.Button1Click(Sender: TObject)    
Exit
Exit
LabeledEdit1  
LabeledEdit1  
!
False
LabeledEdit2  
LabeledEdit2  
<>5  
Y  
=5 - 0!
True
True
False
False
Y LabeledEdit3  

0 . .

 

procedure TForm1.Button1Click(Sender: TObject);

Var A, X, Y: Real; //

Begin

if LabeledEdit1.Text <> '' //

then A:= StrToFloat(LabeledEdit1.Text)

else begin ShowMessage(' '); //

exit; //

End;

if LabeledEdit2.Text <> '' //

then := StrToFloat(LabeledEdit2.Text)

else begin ShowMessage(' '); //

exit; //

End;

if X <> 5 // 0 =5

Then begin

Y:= A/(5-X);

LabeledEdit3.Text:=FloatToStrF(Y, ffGeneral, 5, 3);

{ : 7, - 3}

End

else ShowMessage(' =5 - 0');

End;





:


: 2016-10-27; !; : 321 |


:

:

,
==> ...

1731 - | 1672 -


© 2015-2024 lektsii.org - -

: 0.009 .