Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2004-03-23
4
Medium Priority
?
376 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
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…
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.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

688 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