Howdy-Tzi wrote

> I thought of that one too -- but if the machine's been on (booted)
> for more than twenty-odd days, the milliseconds exceeds the
> maxinteger and wraps into a negative value. :\


A sneaky way to get around this problem might be to use the systemDate. With
the systemDate you can work out the time elapsed to the nearest second -
like this. <insert email lingo disclaimer here>


global gTheStartTime, gTimeNow

on startMovie
  gTheStartTime = the systemDate
end

on mouseDown
  gTimeNow = the systemDate
end

on stopMovie
  if gTheStartTime = gTimeNow then
    -- simplest case is the same day
    difference = gTimeNow.seconds - gTheStartTime.seconds
  else 
   -- start time was an earlier day.
    daysDifference = (gTimeNow - gTheStartTime)
    --   work out the seconds elapsed to midnight of the current day
   secondsElapsed = daysDifference * (24*60*60) - gTimeNow.seconds
   -- ... then add the seconds elapsed on the current day
   difference = secondsElapsed + gTimeNow.seconds
  end if
  put difference
end 



Luke

----------------------------------------------------------------
|  Mecca Medialight | http://www.meccamedialight.com.au/       |
|  Lingo Resources  | http://www.lingoworkshop.com/            |
----------------------------------------------------------------


[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email 
[EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]

Reply via email to