unit Unit1;

interface

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

type
  TForm1 = class(TForm)
    Button1: TButton;
    Button2: TButton;
    Button3: TButton;
    Button4: TButton;
    Button5: TButton;
    procedure Button5Click(Sender: TObject);
    procedure Button4Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}
{$J+}

procedure TForm1.Button1Click(Sender: TObject);
begin
  if Button1.Caption='Zamknij' then Button1.Caption:='Otwórz'
  else Button1.Caption:='Zamknij';

end;

procedure TForm1.Button2Click(Sender: TObject);
const i:integer=1;
begin
  if i=5 then ShowMessage('Już wystarczy');
  Inc(i);

end;

procedure TForm1.Button3Click(Sender: TObject);
const j:integer=2;
begin
  case j of
  1: Button3.Caption:='Pierwszy';
  2: Button3.Caption:='Drugi';
  3: Button3.Caption:='Trzeci';
  end;
  j:=(j mod 3)+1;

end;

procedure TForm1.Button4Click(Sender: TObject);
begin
  Button4.Enabled:=false;
end;

procedure TForm1.Button5Click(Sender: TObject);
begin
   Button4.Enabled:=true;
end;

end.
