Scripts that are already running

DunbarX at aol.com DunbarX at aol.com
Fri Sep 24 09:36:46 EDT 2010


Is there a way that a process of some sort can be implemented while a 
script is running?

I answered a question in the forums where someone wanted a way to enable a 
button when a certain condition was met. I set up a recursive "send in time" 
handler. The stack operates normally, and when a script might attain that 
condition, the button property was set. Usual stuff.

But my question goes way back to HC. If the condition was met while a 
script is running, the change would not be detected until the handler finished.   
This was always normal.

In other words:

1- Say the condition of interest was that a custom property ("myProp") of a 
button was the number 50.
2- I initialize that button property to empty.
3- I set up a recursive "send in time" handler to check the property. It 
runs happily "in the background", does its thing whenever it sees that the 
property is set to 50, and then exits. Well and good.
4- I set up a repeat loop somewhere:

repeat with y = 1 to 100
   set the "myProp" of myButton to y
end repeat

So the property becomes 50 fairly soon, but the "send in time" handler 
won't see that fact until the repeat loop (and its handler itself, of course) 
ends. Did I mention I thought this was normal behavior?

Is there a way to "interrupt", or rather, "interrogate", the repeat loop? I 
am not talking about checking the property within that running code.

I assume not.

Thanks,

Craig Newman



More information about the use-livecode mailing list