Re: Countdown HH:MM:SS

2011-07-21 Thread James Hurley
Message: 15 Date: Wed, 20 Jul 2011 15:19:07 -0400 From: Roger Eller roger.e.el...@sealedair.com To: How to use LiveCode use-livecode@lists.runrev.com Subject: Re: Countdown HH:MM:SS Message-ID: CAAT6EXPFGQY-=S6irWxERo3BXK=ftn5y+bjdn55plqvz3lk...@mail.gmail.com Content-Type: text

Re: Countdown HH:MM:SS

2011-07-20 Thread Ken Ray
On Jul 19, 2011, at 10:00 PM, dunb...@aol.com wrote: Hi. Shorter? It already can be pretty short. MUCH shorter? Where's Colin? Here's the fastest way I know: on mouseUp DisplayTime end mouseUp on DisplayTime put the long time into tTime convert tTime to dateItems split tTime by

Re: Countdown HH:MM:SS

2011-07-20 Thread Roger Eller
On Wed, Jul 20, 2011 at 2:12 AM, Ken Ray wrote: On Jul 19, 2011, at 10:00 PM, dunb...@aol.com wrote: Hi. Shorter? It already can be pretty short. MUCH shorter? Where's Colin? Here's the fastest way I know: on mouseUp DisplayTime end mouseUp on DisplayTime put the long time

Re: Countdown HH:MM:SS

2011-07-20 Thread James Hurley
Roger Is this what you are looking for? on mouseUp set itemdel to : put the long time into tTime put char 1 to -4 of tTime into field 1 convert tTime to dateItems set the hms of me to tTime countDown end mouseUp on countDown put the hms of me into temp subtract 1

Re: Countdown HH:MM:SS

2011-07-20 Thread James Hurley
Roger, I forgot the stop clause. Maybe: if field 1 is 0:0:0 then --or whatever --Do your business else send countDown to me in 1 sec end if Roger Is this what you are looking for? on mouseUp set itemdel to : put the long time into tTime put char 1 to -4 of tTime into

Re: Countdown HH:MM:SS

2011-07-20 Thread Bob Sneidar
Hey as long as we are talking about dates and times, I am going to need soon a method to determine if a block of time intersects with another. Specifically I will need to do this in an SQL query. I suppose the best way would be to store all dates in julian format, then have a query that, given

Re: Countdown HH:MM:SS

2011-07-20 Thread Ken Ray
Using the dateItems is definitely the right direction, but my objective is to count backwards from for example; 2 hours, 45 minutes, and 59 seconds while updating the display field every second. When the countdown reaches 00:00:00, I would play a sound of do other actions. Sorry about

Re: Countdown HH:MM:SS

2011-07-20 Thread Pete
Hi Bob, Depending on your requirements, your tests might ned to be = and =. Also, SQL has a BETWEEN operator that would make your code a little more readable: SELECT * FROM xyz WHERE startDate BETWEEN savedStartDate AND savedEndDate I don't think you need to store your dates in julian

Re: Countdown HH:MM:SS

2011-07-20 Thread Bob Sneidar
Ah! Very useful thank you! Bob On Jul 20, 2011, at 10:50 AM, Pete wrote: Hi Bob, Depending on your requirements, your tests might ned to be = and =. Also, SQL has a BETWEEN operator that would make your code a little more readable: SELECT * FROM xyz WHERE startDate BETWEEN

Re: Countdown HH:MM:SS

2011-07-20 Thread Roger Eller
On Wed, Jul 20, 2011 at 1:06 PM, Ken Ray wrote: Using the dateItems is definitely the right direction, but my objective is to count backwards from for example; 2 hours, 45 minutes, and 59 seconds while updating the display field every second. When the countdown reaches 00:00:00, I

Re: Countdown HH:MM:SS

2011-07-20 Thread Nonsanity
I wouldn't rely on the send in time structure to actually fire every second. It's going to slip over time as the computer takes periodic spikes of use. If you want New Years Eve accuracy of the final countdown, you should probably re-calculate the delta based on the current time continuously.

Re: Countdown HH:MM:SS

2011-07-20 Thread Nonsanity
Or with the other features you mentioned: on mouseup -- start 1 hour timer button get the seconds put it into now convert now to internet date put now into fld 1 -- display the current time add 3600 to it -- one hour from now set the targetTime of me to it convert it to

Re: Countdown HH:MM:SS

2011-07-20 Thread Scott Rossi
Recently, Nonsanity wrote: I wouldn't rely on the send in time structure to actually fire every second. It's going to slip over time as the computer takes periodic spikes of use. If you want New Years Eve accuracy of the final countdown, you should probably re-calculate the delta based on the

Re: Countdown HH:MM:SS

2011-07-20 Thread Roger Eller
On Wed, Jul 20, 2011 at 6:20 PM, Scott Rossi wrote: Recently, Nonsanity wrote: I wouldn't rely on the send in time structure to actually fire every second. It's going to slip over time as the computer takes periodic spikes of use. If you want New Years Eve accuracy of the final

Re: Countdown HH:MM:SS

2011-07-20 Thread Ken Ray
The variety of flavors in script methods to achieve a countdown timer are obviously many. The first place I looked for such was in revOnline (user samples). Would those of you in this thread that contributed a version of a solution (Ken, Chris, James, others) be ok with me compiling these

Countdown HH:MM:SS

2011-07-19 Thread Roger Eller
I know I can convert the time to seconds, do the math, split it up into HH:MM:SS, and repeat a send myCounter in 1 sec to update a countdown timer field, but before I begin chiseling on a new square wheel, is there a better (shorter) way? ˜Roger ___

Re: Countdown HH:MM:SS

2011-07-19 Thread dunbarx
Hi. Shorter? It already can be pretty short. MUCH shorter? Where's Colin? Craig Newman -Original Message- From: Roger Eller roger.e.el...@sealedair.com To: How to use LiveCode use-livecode@lists.runrev.com Sent: Tue, Jul 19, 2011 5:36 pm Subject: Countdown HH:MM:SS I know I can

Re: Countdown HH:MM:SS

2011-07-19 Thread Jeff Massung
Lookup the convert function... dateAndTime and look at the format dateItems. That probably has what you care about. HTH, Jeff M. ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your