An alarm thingy

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Andycal
Posts: 144
Joined: Mon Apr 10, 2006 3:04 pm

An alarm thingy

Post by Andycal » Fri Jun 05, 2009 3:04 pm

Just been playing with the 'Send' command to use in conjunction with my new Twitter app (thanks for all the help on that, found just the right code!).

So now I want to create a times tweets system. I was thinking of a file with times and events, comma seperated etc. but then I got stuck on the 'how do I get RunRev to actually read it and do something at a certain time'.

I've read up on the 'send' command and it seems to be in the right area so I can read the file work out the difference between the time it should trigger and the time now and go:

send "something" to me in xx minutes

But can I do this multiple times? Will it use up oodles of processor and more importantly, is there a better way of doing it?

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10049
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Post by FourthWorld » Fri Jun 05, 2009 3:59 pm

You can do this safely by just checking to see if the message you're about to send is already in the pendingMessages:

Code: Select all

on HandleMessage
    DoSomethingInResponseToMessage
    if pMessage is not in the pendingMessages then
       send "HandleMessage" to me in 120 secs
    end if
end HandleMessage
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Post Reply