use-revolution Digest, Vol 23, Issue 66
Jim Hurley
jhurley at infostations.com
Fri Aug 19 14:19:11 EDT 2005
>
>Message: 17
>Date: Fri, 19 Aug 2005 13:13:40 -0400
>From: Jon <jbondy at sover.net>
>Subject: resolution of Time in Rev
>To: Revolution List <use-revolution at lists.runrev.com>
>Message-ID: <43061344.6010203 at sover.net>
>Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
>I'm trying to schedule something to happen some time in the future. Due
>to some other complexities, I cannot just do a
>
>send "mouseUp" to me in 1000 seconds
>
>Rather, I have to wake up every 10 seconds and figure out whether it is
>time to do the processing or not. The current code is presented below.
>
>The interesting thing is that, despite the claim that Rev times are in
>seconds, and even in milliseconds, the values I'm seeing are in
>increments of 60 seconds. I flagged a line in the code below. Rather
>than seeing "60" and then "50" and then "40", etc, I instead see "60" 6
>times and then "0". Am I doing something wrong? Or, rather, what am I
>doing wrong?
>
>BTW: feel free to show me how I should have written this: it is hugely
>awkward and could be done much easier in languages that I know better.
>
>:)
>
>Jon
>
>on mouseup
> local mostRecentFTPTime
> -- is it time yet?
> convert the date && the time to dateItems
> subtract field "TestFreq" from item 5 of it
> convert it to seconds
> put item 1 of it into currTime
> if currTime < mostRecentFTPTime then
> -- show the user how long before next test
> set the text of field "TimeToGo" to mostRecentFTPTime - currTime &
>" secs to go" -- this is the line I'm talking about
> send "mouseUp" to me in 10 seconds
> exit mouseUp
> end if
>
> -- do the FTP stuff here!
>
> convert the date && the time to seconds
> put it into mostRecentFTPTime
> send "mouseUp" to me in 10 seconds
>end MouseUp
>
Jon,
The information in the variable mostRecentFTPTime is lost after
mouseUp is run. To save that data you might want to consider a custom
variable, for example: set the mostRecentFTPTime of me to it, and
earlier: if currTime < the most mostRecentFTPTime of me then
Jim
More information about the use-livecode
mailing list