unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
btn1: TButton;
procedure btn1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure AssertErrorHandler(const Message, Filename: string; LineNumber: Integer; ErrorAddr: Pointer);
var
S: String;
begin
S := Format('%s (%s, line %d, address $%x)',[Message, Filename, LineNumber, Pred(Integer(ErrorAddr))]);
//OutputDebugString(PChar(s));
showmessage(PChar(S));
end;
procedure TForm1.btn1Click(Sender: TObject);
begin
Assert(1<>1);
end;
initialization
AssertErrorProc := @AssertErrorHandler
finalization
end.