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
Solved

BCB: Best way to make a Schedule/Agenda (Trigger events)?

Posted on 2004-03-23
4
371 Views
Last Modified: 2010-04-01
Hi Experts,

I'm not the best programmer in the world, but I'm learning.


At the moment I am designing an Personal Assistant API. (Borland Builder 6)

Now I want to implement a Schedule/Agenda in it.


Of course there are several ways to trigger an event like a Birthday or a Appointment etc.

Now I want to know what will be the best way to do this?

-Read everything from 1 large ('Database') file every minute?
-Make a 'trigger-file' (or array)(that is checked every min.) and only read from the 'Database' when triggered?
-..?

And how should you handle recurring events? (adding en deleting)

Does anybody have/know an example/a tutorial or maybe some useful code(with explanation)/links?


Thx in advance, very appreciated!

Best regards, Roland(BE).
0
Comment
Question by:Roland1980
4 Comments
 
LVL 16

Expert Comment

by:George Tokas
ID: 10667946
Hello there,
This is what I propose:
Use a TDateTimePicker from the Win32 tab. That is for choose the date.
Implement an Hour setter ( i.e. 2 Edit boxes associated with up/down controls). Those are to set the time.
use a button to add the date and time do trigger the event and store the data in a TList or something.
Add a TTimer to tick every minute and check if the date and time is reached to fire your event.
Check for that like this:
 TDateTime   EventDateTime,NowDateTime;
 //Load the EventDateTime from your list
 NowDateTime = Now();
 if(EventDateTime >= NowDateTime)
  {
       //Fire Event here and don't forget to erase the event from the list when finnished.
  }

Your "database" will be your list.
BCB have lots of components and methods you can use.

Hope it is helpfull
regards,
gtokas.
0
 

Author Comment

by:Roland1980
ID: 10672176
Hi gtokas,

That did help me on my way.

But what about when the 'database' gets big?
Then every minute the whole 'database' has to be read.

So, in your example, I can create a file, load it in a TList or something and check it every minute.

And how should I handle recurring events? (adding en deleting)

Roland(BE).
0
 

Accepted Solution

by:
modulo earned 0 total points
ID: 10967782
PAQed, with points refunded (205)

modulo
Community Support Moderator
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

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