Solved

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

Posted on 2004-03-23
4
373 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
[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
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

Independent Software Vendors: 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

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

734 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