Best way to repeat on a timer?

Alex Rice alrice at ARCplanning.com
Fri Aug 8 10:55:00 EDT 2003


On Friday, August 8, 2003, at 08:03  AM, RGould8 at aol.com wrote:
> on checkstatus
>      put shell(unixcallgoeshere) into field "status result"
>      send "checkstatus" to this stack in 3 seconds
> end checkstatus
>
>
> The unix call I'm using spits back it's result instantaneously, so 
> there shouldn't be a backlog via the unix side of things.  Is it bad 
> to have a handler call itself via a timer - - - does that create some 
> sort of "nesting" problem?

I don't think so - I'm pretty sure I've seen animations scripted this 
way- a button sends moveSelf to itself in a  few ticks.

re: the lag time- it's to be expected I think because shell(), no 
matter what the command being issued is, forks a subprocess, which is a 
relatively heavyweight thing to do every 3 seconds. Maybe you can do 
something like

on checkstatus
  if not inWindowDrag and not inWindowResize then
    ... do shell stuff
  end if
  send "checkstatus" to this stack in 3 seconds
end checkstatus

Also, maybe there is an equivalent applescript to inspect the user's 
system settings?

Alex Rice, Software Developer
Architectural Research Consultants, Inc.
http://ARCplanning.com




More information about the use-livecode mailing list