unit Unit1;

interface

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

type
  TForm1 = class(TForm)
    Edit1: TEdit;
    Edit2: TEdit;
    Edit3: TEdit;
    Button1: TButton;
    Button2: TButton;
    procedure Button2Click(Sender: TObject);
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    e1,e2,e3:integer;
    function suma_kwadratow:integer;
  end;

var
  Form1: TForm1;

implementation

uses Unit2;

{$R *.dfm}

//funkcja dopisana przez programistę, będzie wywołana w module drugim
function TForm1.suma_kwadratow:integer;
begin
  Result:=sqr(e1)+sqr(e2)+sqr(e3);
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  e1:=StrToIntDef(Edit1.Text,0);
  e2:=StrToIntDef(Edit2.Text,0);
  e3:=StrToIntDef(Edit3.Text,0);
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
  Form2.Show;
end;

end.
