Solved

For Madshi or anyone that can help.

Posted on 2002-04-20
5
134 Views
Last Modified: 2010-04-04
Madshi, there is one other problem I have using the code you gave me. How can I make it so that the log it creates looks like this:

Application Log - Generated on April 14, 2002
---------------------------------------------
Program started.


The first time the log is created, it writes the Application Log... and the -------------. Afterwards,
it starts logging stuff.

Please help! I tried doing it but failed miserably. More points if needed. Thanks!
0
Comment
Question by:DelFreak
  • 3
  • 2
5 Comments
 
LVL 20

Expert Comment

by:Madshi
ID: 6957772
Simply put the following 3 lines into the beginning of your project file (*.dpr):

program yourProgram;

uses [...];

begin
  Log('Application Log - Generated on ' + DateTimeToStr(Now));
  Log('-------------------------');
  Log('Program started.');
  Application.Initialize;
  [...];
  Application.Run;
end.

Regards, Madshi.
0
 

Author Comment

by:DelFreak
ID: 6959365
Well, that's what I'm currently using now. What I want is for the function to write the date the log was created and then start logging from there. No other date. Thanks!
0
 
LVL 20

Accepted Solution

by:
Madshi earned 20 total points
ID: 6964998
I'm not sure if I understand you right. Maybe you mean this?

var firstLog : boolean = true;
procedure log(...);
begin
  if firstLog then begin
    firstLog := false;
    Log('Application Log - Generated on ' + DateTimeToStr(Now));
    Log('-------------------------');
    Log('Program started.');
  end;
  [...] // hier comes the original log source code
end;

Regards, Madshi.
0
 

Author Comment

by:DelFreak
ID: 6965468
Cool! Let me try it. Thanks!
0
 

Author Comment

by:DelFreak
ID: 7171089
Thank you! Your code worked great!
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question