converting short time to seconds

Nicolas Cueto niconiko at
Fri Sep 16 23:06:46 EDT 2011


This code rather than my prose probably explains better what I'm after:

on mouseUp
   set the twelveHourTime to false
   put the short time into tSomeClockTimeTodayInSeconds
   convert tSomeClockTimeTodayInSeconds to seconds
   put tSomeClockTimeTodayInSeconds into tSameClockTimeTomorrowInSeconds
   put 86400 into tNumberOfSecondsInOneDay
   add tNumberOfSecondsInOneDay to tSameClockTimeTomorrowInSeconds
   send "StartSomeLoopingCycleThatEventuallyTriggersAChimeSound" to me
in 0 milliseconds
end mouseUp

Here's the why. I have a stack that takes a list of clock-times and
plays a chime-sound at each clock-time. When the last clock-time has
played, the list of clock-times is reloaded for the stack to replay
the chimes the next day and the next ad infinitum. However, to avoid
working with dates, I figured that adding the number of seconds in one
day to each of the clock-times would do the trick.

Is there a problem with my logic?

I've tried it out on my stack, but the chimes did not play the next
day. Perhaps it's something else, but I thought I'd check this out

I also played around with my PC's clock-date settings to confirm that
LC's "convert tTime to seconds" will give different values for a given
clock-time depending on the system date.


Nicolas Cueto

More information about the Use-livecode mailing list