Reminder Project
-
Hi Guys. I need a little advice. I am attempting to write a little reminder for my girlfriend. I orriginaly tried storing the details in a .mdf which worked OK for storing but then I couldn't figure out how to check if the reminder date and time == DateTime.Now. I was then advised here to try using XML which I then tried, considering I didn't know much about XML. This worked fine and the only problem i had with thsi was that when the reminder date and time == DateTime.Now it like opped up 60 message boxes, one for every tick on the timer. I would like to know how I can get it to only pop up one message box or advice on the best way to do this. Thanks in advance.
-
Hi Guys. I need a little advice. I am attempting to write a little reminder for my girlfriend. I orriginaly tried storing the details in a .mdf which worked OK for storing but then I couldn't figure out how to check if the reminder date and time == DateTime.Now. I was then advised here to try using XML which I then tried, considering I didn't know much about XML. This worked fine and the only problem i had with thsi was that when the reminder date and time == DateTime.Now it like opped up 60 message boxes, one for every tick on the timer. I would like to know how I can get it to only pop up one message box or advice on the best way to do this. Thanks in advance.
You probably need another varible. Something like
bool sentReminder = false;
if (time == datetime.now && !sendreminder)
{
sentReminder = true;
//do your thing
}if (time != datetime.now)
{
//re-set for next time
sentReminder = false;
}Anyway, that is one quick thought on what you could do. Ben
-
Hi Guys. I need a little advice. I am attempting to write a little reminder for my girlfriend. I orriginaly tried storing the details in a .mdf which worked OK for storing but then I couldn't figure out how to check if the reminder date and time == DateTime.Now. I was then advised here to try using XML which I then tried, considering I didn't know much about XML. This worked fine and the only problem i had with thsi was that when the reminder date and time == DateTime.Now it like opped up 60 message boxes, one for every tick on the timer. I would like to know how I can get it to only pop up one message box or advice on the best way to do this. Thanks in advance.
I'm sure there are better ways, but this would work.
//Declarations
int intFlag = 0;//On timer tick
if ((date and time == DateTime.Now) && (intFlag == 0))
{
intFlag++;
Show reminder;
}if (date and time != DateTime.Now)
{
intFlag = 0;
}-- modified at 16:25 Wednesday 3rd October, 2007
-
I'm sure there are better ways, but this would work.
//Declarations
int intFlag = 0;//On timer tick
if ((date and time == DateTime.Now) && (intFlag == 0))
{
intFlag++;
Show reminder;
}if (date and time != DateTime.Now)
{
intFlag = 0;
}-- modified at 16:25 Wednesday 3rd October, 2007
-
np.. good luck
-
np.. good luck
-
Adam, last question. The exmple you provided, is that for using with SQL or with XML? I'm a bit lost at which base to use for storing the information in.
That was for C#, which i am assuming you are writing your GUI in. The code was just a logic loop so it will only post your reminder once. I don't personally know XML, but SQL is a great program to store information. There's an excellent article on here about SQL by Matt Newman, it might be useful for your project. http://www.codeproject.com/cs/database/sql\_in\_csharp.asp Oh, and the "data and time" in there would be a string in your app... if your using SQL you may have to use the .TrimEnd( ) Command to get rid of extra spaces at the end of the saved "date and time" to make it work right as SQL fills any un-used room with spaces for you. I hope that answered your question, if not just message back. Adam
--Its not broken if it never worked.