[Q] send in time and response times from apps

Shao Sean shaosean at unitz.ca
Mon Mar 18 16:14:01 EST 2002


> IMFO, it really depends on what else is going on with your application.
in the part i'm writing (the calendar object) not really a heck off a lot
(on the intial openBackground there's a lot going on, but after that..
nada)..

bascially my code works something like so:

on openBackground
  -- script to build the calendar here
  calendar_checkForDateChange
end openBackground

on calendar_checkForDateChange
  local vDateItem, vTodayDate
  put 18 into vTodayDate -- this is created on the fly in the real script
  convert the seconds to dateItems
  put it into vDateItems
  if (item 3 of vDateItems <> vTodayDate) then
    -- the date in vDateItems is different from the stored date
    send "openBackground" to me
  else
    -- dates match
    send "calendar_checkForDateChange" to me in 60 seconds
  end if
end calendar_checkForDateChange

i guess a lot of it depends on how much is going on in whatever application
the developer embeds the calendar into..


> script a mechanism to assure the loop stops when the user leaves the
hehe.. good idea.. except the fact that the calendar object runs as a
background object (only way i could it to do something "openBackground"
there needs to be some kind of internal "open" handler for the objects..)


> And while we're on the subject, am I correct that any "send ... in"
> event cannot guarantee precise timing?
when i did my testing with the 60sec interval, it was being fired every
61secs, but i'm not too worried about the extra second here or there as it's
just to update the calendar when there's a date change




More information about the use-livecode mailing list