unit Main;

interface

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



type
  EWyjatek = class(EMathError);

  TMainForm = class(TForm)
    Panel1: TPanel;
    btnCLOSE: TBitBtn;
    btnStart1: TBitBtn;
    procedure btnStart1Click(Sender: TObject);
    procedure btnCLOSEClick(Sender: TObject);
  private

  public

  end;

var
  MainForm: TMainForm;

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

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

procedure TMainForm.btnStart1Click(Sender: TObject);
var
   a     : Double;
   b     : Double;
   wynik : Double;

begin
   a     := 123.45;
	 b     := 0.0;
	 wynik := 0.0;

	try
   	wynik := a / b;
	except
     on e : EZeroDivide do
     begin
         raise EWyjatek.Create('To jest moja wiadomość ' + #10#13 + e.Message);
     end;
   end;
end;

end.

