Hello, I making some test with exceptions
I did this test program
unit Unit1 ;
{$mode objfpc}{$H+}
interface
uses
Classes ,SysUtils ,FileUtil ,Forms ,Controls ,Graphics ,Dialogs ,StdCtrls ;
Type MiError = Class (Exception);
type
{ TForm1 }
TForm1 = class(TForm )
Button1 :TButton ;
Edit1 :TEdit ;
procedure Button1Click (Sender :TObject );
private
{ private declarations }
Procedure MiPrueba;
public
{ public declarations }
end;
var
Form1 : TForm1 ;
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1 .Button1Click (Sender :TObject );
begin
Try
MiPrueba;
Except
On MiError do
ShowMessage ('Error mio');
Else
ShowMessage (Exception.Message); //Show the "generic" exception
end;
end;
procedure TForm1 .MiPrueba ;
begin
IF (StrToInt (Edit1.Text)) = 1 Then
Begin
Raise MiError.Create('Mi Error');
end;
end;
end.
Well, I want to show the name of the "generic" exception, where I have the showMessage
Thanks
/BlueIcaro