Solved

Running a procedure at set times?

Posted on 1997-10-13
3
165 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

760 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now