Solved

Running a procedure at set times?

Posted on 1997-10-13
3
174 Views
Last Modified: 2010-04-04
I need to run several procedures at set times every day or on certain days of the week. What i need to know is what component/functions i can use to achieve this eg.
how will i run a procedure at seven 'o clock every morning?
0
Comment
Question by:naickers2
3 Comments
 
LVL 3

Expert Comment

by:mirek071497
ID: 1347381
In Windows NT you can use scheduling jobs, but in Windows95 you must write simple scheduler. However we must know more. especially Delphi Version and Windows Version.
Here are the second question named "scheduling system" which is about the same problem. Sasas give comment to this question :
"Look for the Delphi Super Page at www.suncite.icm.edu.pl"

This is really good start point, so try and ask what you need more.
0
 

Accepted Solution

by:
AllenC earned 100 total points
ID: 1347382
procedure TForm1.Timer1Timer(Sender: TObject);
var
  Present : TDateTime;
  Hour, Min, Sec, MSec : Word;
begin
  Timer1.Interval := 60000;  { Check for time every 60 seconds }
  Present := Now;
  DecodeTime(Present, Hour, Min, Sec, MSec);
  If (Hour = 7) and (Min = 0) then
   begin
     { Do the job }
   end;
end;

You should also use the trayicon component to "hide" or minize your program.

P.S. this is not the best way to do it, but it works.
0
 

Author Comment

by:naickers2
ID: 1347383
Thanx for the help. This is exactly what i need.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
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…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

791 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