Making an operation every x seconds

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
tal
Posts: 84
Joined: Thu Jul 02, 2009 3:27 pm

Making an operation every x seconds

Post by tal » Wed Jun 09, 2010 2:01 pm

Hi,

Revolution is not multi thread, so I dont know how to make an operation for example every 120 seconds.

Every 120 seconds a script is executed and when finished it waits 120 seconds to be executed again... and during this duration, the application works normally. Have you got a clue? Thanks

Tal

Klaus
Posts: 14208
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Making an operation every x seconds

Post by Klaus » Wed Jun 09, 2010 2:50 pm

Hi Tal,

you can "send" a message every x (milli-)seconds, this is the way to go:

Code: Select all

command doThis
  ## do this
  ## do that
  ## do another important thingie
  send "doThis" to me in 120 secs
end dothis
Then call it once whenever you need to start you actions like

Code: Select all

on openstack
  dothis
  ...
end openstack
Lookup "send" and "pendingmessages" in the docs (Rev dictionary).


Best

Klaus

tal
Posts: 84
Joined: Thu Jul 02, 2009 3:27 pm

Re: Making an operation every x seconds

Post by tal » Wed Jun 09, 2010 2:55 pm

Ok I try it, thank you

Post Reply