Solved

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

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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
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 use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

746 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

11 Experts available now in Live!

Get 1:1 Help Now