AW: How to implement a timebased reminder?
kee at kagi.com
Fri Jun 11 08:34:31 EDT 2010
I do a bunch of this run forever kind of stuff.
If I was going to build a reminder system, here's how I'd rig it.
First I'd store the data about each alarm. For simplicity sake lets assume you have a table that has three columns: alarm time, event name, status
You could store alarm time using dateitems
Event name would be the text you want displayed
status would be a marker as to whether you acked the alarm ("old" or "new") and whether a "send .. in" had been sent for this alarm ("active").
Then on stack startup, I'd go through every alarm in the list and any "active" markers I would set back to "new".
Then for any "new" markers, if the alarm time had already past, I'd put up the alarm and request that the user ack it, and I'd set the status for that alarm to "old".
Then for all "new" alarms, IF there is a future alarm find the one that is the next one to happen and do the "send .. in ..." script for it AND I'd set its status to "active" so that you know not to create another "send ... in" message.
I have no idea what the longest "send ... in" time period is but to be safe, maybe your maximum time delay is 4 hours? If you don't have an alarm within 4 hours, just do a 4 hour "Send In" and check things when it next wakes up.
The "send ... in" message would always be the same message. Essentially it would tell your system to wake up and scan the alarms and see if there are any that are active or new that need to be displayed to the user.
The only trick to all of this is I have no idea what happens with the send in message if your computer has gone to sleep.
If I was going to build it ...
On Jun 11, 2010, at 4:51 AM, Tiemo Hollmann TB wrote:
> Hi Klaus,
> yes I tried it already with ditto, but my Win7 machine started smoking and
> making funny noise!
> Using "send in" in a self calling handler to get the infinite "loop" or what
> would be the calling handler?
>> -----Ursprüngliche Nachricht-----
>> Von: use-revolution-bounces at lists.runrev.com [mailto:use-revolution-
>> bounces at lists.runrev.com] Im Auftrag von Klaus on-rev
>> Gesendet: Freitag, 11. Juni 2010 13:39
>> An: How to use Revolution
>> Betreff: Re: How to implement a timebased reminder?
>> Hi Tiemo,
>>> I would like to create a timebased reminder (like a reminder from a
>>> app), which runs the whole day "in the background"/ as a task icon
>>> or gadget and reminds me in settable intervals about anything.
>>> How do you realize this kind of app with using a minimum of the
>>> power? Using idle and idlerate or any kind of loop or perhaps
>>> completely different?
>> Do not use IDLE!
>>> Which would be the less consuming approach?
>>> Any hint welcome
>> this also can be done with "ditto" :-D
>> No, just kidding, use "send ... in... " for this purpose!
>> Klaus Major
>> klaus at major.on-rev.com
>> use-revolution mailing list
>> use-revolution at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
I check email roughly 2 to 3 times per business day.
Kagi main office: +1 (510) 550-1336
More information about the Use-livecode