"send" in 24-hours

stephen barncard stephenREVOLUTION2 at barncard.com
Fri Sep 9 01:52:38 EDT 2011


Here's a technique that I used that provides very accurate and dependable
long period timer

use 'send in time' with SHORT timings to check the current time.
then compare the number obtained against your desired timeout value.
It could even be a list of values each being a trigger for an event. Use *send
in tim*e values like one per second or even once per minute.

This also works great for countdown and count up visible counters.

sqb


On 8 September 2011 22:09, Nicolas Cueto <niconiko at gmail.com> wrote:

> Hello,
>
> Two parts to my quandary, both relating to a school-chime stack I'm
> making -- it plays a "chime" sound-file at hourly-intervals (more or
> less) every weekday.
>
> First, I recall reading once a warning about overly long "send"
> values. In my stack's case, the "send A in X seconds" values are
> either 60 minutes or 24-hours (converted to seconds).  What, if any,
> concerns should I have when using "send" with such large values?
>
> Second, I've got my stack to work with this set of time-values:
>
> 8:00
> 12:59
> 13:02
> 13:03
>
> Obviously, I haven't tested a "send in 60 minutes" value. But, up to
> the 13:03-chime, no problems.
>
> Now, I want to test the jump in time from one day to the next -- say
> between the 13:03-chime on Thursday and the 8:00-chime on the next day
> Friday -- but, obviously, I do not want to wait a whole day for that.
> I tried changing my PC's day-and-time settings, but no go.
>
> If it helps, here is my script for calculating the "send" time
> difference between 13:03 and 8:00 the next day:
>
> put "13:30" into tTimeA
> convert tTimeA to seconds
> put "11:40" into tTimeB
> convert tTimeB to seconds
> convert tTimeB to dateitems
> add 24 to item 4 of tTimeB
> convert tTimeB to seconds
> put abs(tTimeB - tTimeA) into tNextChimeTimeInSeconds
> send "play chime" to me in tNextChimeTimeInSeconds seconds
> set the cpPending of me to the result
>
>
> Thanks.
>
> --
> Nicolas Cueto
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



-- 



Stephen Barncard
San Francisco Ca. USA

more about sqb  <http://www.google.com/profiles/sbarncar>



More information about the use-livecode mailing list