Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

For Madshi or anyone that can help.

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

Industry Leaders: 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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Suggested Courses

721 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