首页 > Windows开发 > 详细

Delphi之Exception获得错误信息

时间:2019-04-11 15:23:39      阅读:150      评论:0      收藏:0      [点我收藏+]
1 unit Unit1;
 2 
 3 interface
 4 
 5 uses
 6   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
 7   Dialogs, StdCtrls;
 8 
 9 type
10   TForm1 = class(TForm)
11     Button1: TButton;
12     procedure Button1Click(Sender: TObject);
13   private
14     { Private declarations }
15   public
16     { Public declarations }
17   end;
18 
19 var
20   Form1: TForm1;
21 
22 implementation
23 
24 {$R *.dfm}
25 
26 procedure TForm1.Button1Click(Sender: TObject);
27 var
28   int1: Integer;
29 begin
30   try
31     int1 := StrToInt(‘A‘);
32   except
33     ShowMessage(Exception(ExceptObject).Message);
34   end;
35 end;
36 
37 end.

Delphi之Exception获得错误信息

原文:https://www.cnblogs.com/linjincheng/p/10689777.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!