Ich hab ne Frage zum Quelltext...
Wo ist der Fehler???
Der zeigt immer denn selben fehler an....
nämlich:
[Hint] Unit1.pas(50): Value assigned to 'x2' never used
[Hint] Unit1.pas(49): Value assigned to 'x1' never used
Delphi-Quellcode:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 =
class(TForm)
aedit: TEdit;
bedit: TEdit;
cedit: TEdit;
Button1: TButton;
x1edit: TEdit;
x2edit: TEdit;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var a,b,c,p,q,x1,x2:real;
begin
a:=StrToInt(aedit.Text);
b:=StrToInt(bedit.Text);
c:=StrToInt(cedit.Text);
if
a=1
then
begin
p:=b;
q:=c;
end
else
begin
p:=b/a;
q:=c/a;
x1:=-p/2+sqrt(sqr(p/2)-q);
x2:=-p/2+sqrt(sqr(p/2)-q);
if
sqr(p/2)-q>0
then
begin
x1:=0;
x2:=0;
end
else
if
sqr(p/2)-q=0
then
begin
x1:=-p/2;
x2:=-p/2;
end
else
begin
x1:=99;
x2:=99;
end;
x1edit.Text:=floatToStr(x1);
x2edit.Text:=floatToStr(x2);
end;
end.
Bitte um Hilfe....
was mache ich Falsch
[edit=Sharky]Delphi-Tags gesetzt. Mfg, Sharky[/edit]