For Madshi or anyone that can help.

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!
DelFreakAsked:
Who is Participating?
 
MadshiConnect With a Mentor Commented:
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
 
MadshiCommented:
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
 
DelFreakAuthor Commented:
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
 
DelFreakAuthor Commented:
Cool! Let me try it. Thanks!
0
 
DelFreakAuthor Commented:
Thank you! Your code worked great!
0
All Courses

From novice to tech pro — start learning today.