Solved

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

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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
AVI wait icons for CAnimateCtrl in Visual Studio 2008 MFC 1 161
is twain_32.dll cmpatible with windows 10 ? 10 229
gdb doesn't stop on breakpoint 2 113
Issues with C++ Class 19 105
What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
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.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

756 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