unit Main;

interface

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

type
  TMainForm = class(TForm)
    btnOBLICZAJ: TBitBtn;
    eCyfra: TEdit;
    Label1: TLabel;
    Panel1: TPanel;
    btnCLOSE: TBitBtn;
    procedure btnOBLICZAJClick(Sender: TObject);
    procedure btnCLOSEClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  MainForm: TMainForm;

implementation
{$R *.dfm}
{------------------------------------------------------------------------------}

procedure TMainForm.btnCLOSEClick(Sender: TObject);
begin
	Close();
end;

procedure TMainForm.btnOBLICZAJClick(Sender: TObject);
var
   kom     : String;
   kwadrat : Integer;
   cyfra   : Integer;

begin
	kom     := '';
   kwadrat := 0;
   cyfra   := 0;

   cyfra := StrToInt(eCyfra.Text);
   // cyfra := StrToIntDef(eCyfra.Text, 0);
   kwadrat := cyfra * cyfra;

   kom := 'Cyfra: ' + eCyfra.Text + ' do kwadratu = ' + IntToStr(kwadrat);
   ShowMessage(kom);
end;

end.
