MESettings.BugReportFile

delphi package - automated exception handling
Post Reply
Andre
Posts: 4
Joined: Wed May 06, 2015 10:02 am

MESettings.BugReportFile

Post by Andre »

I still use Delphi 5 for some old projects and I try to set the Name of the BugReportFile in the OnShow of the mainform:

MESettings.BugReportFile := 'Cash-IT Beheer-' + DM.KassaNaam + '-' + DM.RegNaam + '-Foutrapport.txt';
MESettings.BugReportZip := 'Cash-IT Beheer-' + DM.KassaNaam + '-' + DM.RegNaam + '-Foutrapport.zip';
MESettings.BugReportSendAs := 'Cash-IT Beheer-' + DM.KassaNaam + '-' + DM.RegNaam + '-Foutrapport.txt';
MESettings.ContinueBtnVisible := False;
MESettings.AutoSave := True;
MESettings.ScreenShotAppOnly := True;

The name is a combination of the program, the name of the PC, the name of the client and '-Foutrapport.txt'.
I try to set it there because in the program initialisation the the name of the PC and the name of the client are not yet available.
When I run the application I get an Access vioaltion in the line: MESettings.BugReportFile := 'Cash-IT Beheer-' + DM.KassaNaam + '-' + DM.RegNaam + '-Foutrapport.txt';

How (and where) should I use MESettings?

Kind regards,
Andre,
The Netherlands
Andre
Posts: 4
Joined: Wed May 06, 2015 10:02 am

Re: MESettings.BugReportFile

Post by Andre »

Sorry. my error.

The variable DM.KassaNaam was not yet that set so the error, not the MESettings........
madshi
Site Admin
Posts: 10754
Joined: Sun Mar 21, 2004 5:25 pm

Re: MESettings.BugReportFile

Post by madshi »

Sorry for the late reply.

So all problems solved?

One small hint: "MESettings" is a function which creates an interface. So calling "MESettings" so often is not optimal for performance. I'd recommend do use "with MESEttings() do begin [...] end" and then change all the settings in the begin..end block. That way the interface only needs to be created once.
Post Reply