resolution of Time in Rev

Jon jbondy at sover.net
Fri Aug 19 13:13:40 EDT 2005


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
  




More information about the use-livecode mailing list