Solved

For Madshi or anyone that can help.

Posted on 2002-04-20
5
138 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses
Course of the Month9 days, 13 hours left to enroll

624 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