Avoiding mouse polls

Troy Rollins troy at rpsystems.net
Sun Dec 15 17:24:00 EST 2002


On Sunday, December 15, 2002, at 04:50 PM, Ken Norris (dialup) wrote:

> ----------
>> on cycle
>> change
>> send cycle to me in 333 milliseconds
>> put the result into flashingID
>> end cycle
> ----------
> Is the above "cycle" a special handler? If not, what causes it to 
> repeat?

Ken, that is the cool part. If you look closely, the handler calls 
itself in a third of a second. And every time it runs, it calls itself 
again... and again... and again. But the good part is that you can 
interrupt the cycle by testing a variable state. This particular case 
may have read -

on cycle
change
if myCustomState is false
	send cycle to me in 333 milliseconds
put the result into flashingID
end cycle

You see? The repeat happens because every pass of the handler it calls 
itself to go off again after a short period, UNLESS the state is 
modified. You should note, there is nothing special here. This is the 
absolute most practical way of having interruptible repeats of this kind 
in Rev. It works remarkably well, and once you start using it, you will 
find lots and lots of uses for it.

HTH

--
Troy
RPSystems, LTD
www.rpsystems.net




More information about the use-livecode mailing list