Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

For Madshi or anyone that can help.

Posted on 2002-04-20
5
Medium Priority
?
140 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 80 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…

876 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