[Delphi] czy ktoś wie dlaczego...???

0

...nie chce mi skompilować tego programu????(w zamysle obliczanie kwadratu i szescianu x)

unit miller;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls;

type
TForm1 = class(TForm)
Button1: TButton;
Label1: TLabel;
Label2: TLabel;
Edit1: TEdit;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Button2: TButton;
Memo1: TMemo;
Bevel1: TBevel;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R .dfm}
var
x,y,z:integer;
procedure TForm1.Button1Click(Sender: TObject);
begin
x:=StrToInt(Edit1.Text);
y:=x
x;
memo1.Lines.BeginUpdate;
memo1.Lines.Clear;
memo1.Lines.Add('');
memo1.Lines.Add('');
memo1.Lines.Add('--------------------------------');
memo1.Lines.Add('Kwadrat Podanej liczby x wynosi: '+IntToStr(y));
memo1.Lines.Add('--------------------------------');
memo1.Lines.Add('');
memo1.Lines.Add('');
memo1.Lines.EndUpdate;
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
x:=StrToInt(Edit1.Text);
y:=xx;
z:=y
x;
memo1.Lines.BeginUpdate;
memo1.Lines.Clear;
memo1.Lines.Add('');
memo1.Lines.Add('');
memo1.Lines.Add('--------------------------------');
memo1.Lines.Add('Szescian Podanej liczby x wynosi: '+IntToStr(z));
memo1.Lines.Add('--------------------------------');
memo1.Lines.Add('');
memo1.Lines.Add('');
memo1.Lines.EndUpdate;
end;

end.[ [cya]

0

To chociaż mógłbyć napisać, gdzie pokazuje błąd?

0

Jeżeli masz moduł Math to do potęgowania używaj round(power(x,3));
power(x,3) znaczy x do potęgi 3

0

no nie

0

{$R *.dfm}
var
x,y,z:integer;

tu masz błąd, wrzuć tą deklaracje zmiennych do globalnych czyli powinno wygladac tak"

var
Form1: TForm1;
x,y,z:integer;

0

albo do Buttona2 dorzuć [code]var x,y,z : Integer[/code]

0

cześć .... mi ten program się kompiluje tylko o co w nim chodzi ? :-)

1 użytkowników online, w tym zalogowanych: 0, gości: 1