Hello all,
I'm a newbie scripter and have made a calendar stack that will populate fields with the dates of the month and highlight the current date on preOpen stack.
If I rely on the pre-Open stack handlers to draw the calendar, and the user leaves the stack open overnight, they will find that the current date is "wrong" when they look at their calendar again the next morning, and if "overnight" happened on the last day of the month, the month will be "wrong" too.
What is the best way to periodically poll the system date to see if its "stillToday" so the date highlight can be changed or the calendar can be re-drawn if the user leaves the stack open overnight? I'm sure this is a no-brainer to a real programmer, but I have to plead that I'm a biologist and an artist, so I need somebody merciful to throw me a clue!
Thanks!
How to update Calendar date if stack is left open overnight?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Dear Mistfall,
Calculate the number of seconds until midnight and put this number into variable mySecs. send a message "checkDate" to your stack in mySecs seconds:
send "checkDate" to me in mySecs seconds
The checkDate handler should call the necessary routines in your stack to update time and date.
Best regards,
Mark
Calculate the number of seconds until midnight and put this number into variable mySecs. send a message "checkDate" to your stack in mySecs seconds:
send "checkDate" to me in mySecs seconds
The checkDate handler should call the necessary routines in your stack to update time and date.
Best regards,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Thank you!
Thank you, Mark!
I appreciate the help!
I appreciate the help!