Re: Duplicate simultaneous calls to same handler

2015-01-23 Thread Bob Sneidar
OK this got me going so I put this script in a button: on mouseUp global theCount add 1 to theCount put theCount wait 5 seconds with messages subtract 1 from theCount put theCount end mouseUp Each time I click the button the counter increments, then after the SUM TOTAL of time

Re: Duplicate simultaneous calls to same handler

2015-01-23 Thread Peter Haworth
On Thu, Jan 22, 2015 at 9:58 PM, Mark Wieder wrote: > Script local variables are in a shared common pool. ...except in behavior scripts where each object using the behavior has its own set of script locals. Pete lcSQL Software Home of lcStackBrowser

Re: Duplicate simultaneous calls to same handler

2015-01-23 Thread Bob Sneidar
It would be easy to tell. Start a counter in a local variable before one of the wait with messages statements, increment the counter by one, then after the wait with messages command put the counter into the message box, then subtract one from the counter. If it queues you should see counters go

Re: Duplicate simultaneous calls to same handler

2015-01-23 Thread J. Landman Gay
On 1/22/2015 11:58 PM, Mark Wieder wrote: Each invocation of a function gets its own set of local variables. Script local variables are in a shared common pool. Thanks everybody for all the responses, it was what I needed to know. So basically it acts just like a recursive handler, with the sa

Re: Duplicate simultaneous calls to same handler

2015-01-23 Thread Dave Cragg
> On 23 Jan 2015, at 03:26, J. Landman Gay wrote: > > Suppose I have a long handler that includes a few "wait with messages" so > that users can continue interacting with the stack while it runs. The user > does something that calls the long handler while it is still running from a > previous

Re: Duplicate simultaneous calls to same handler

2015-01-23 Thread Phil Jimmieson
On 23 Jan 2015, at 04:42, Peter W A Wood wrote: > > I found out that you don’t even need two buttons. Hitting one button twice > quickly will give the same effect. > I see this problem with one of my large LiveCode projects, but particularly on Windows systems. Some users double-click ever

Re: Duplicate simultaneous calls to same handler

2015-01-22 Thread Peter W A Wood
I “improved” my script just to check that each time the handler is called it still gets its own local variables: on oneOrTwo local tCount add 1 to tCount put "one" && tCount & return after Field "Field" wait 50 with messages put "two" && tCount & return after Field "Field" end oneO

Re: Duplicate simultaneous calls to same handler

2015-01-22 Thread Mark Wieder
Jacque- >> If so, what happens to the values of the variables? > Google idempotent. Oh, all right. Each invocation of a function gets its own set of local variables. Script local variables are in a shared common pool. Changing them from within a function is commonly referred to as a side effect.

Re: Duplicate simultaneous calls to same handler

2015-01-22 Thread Mark Wieder
Jacque- Thursday, January 22, 2015, 7:26:16 PM, you wrote: > Does the engine queue the second call until the long handler finishes, Every "wait with messages" call will yield time to the system to allow other tasks to continue. > and then send the message from the second call (serial responses)

Re: Duplicate simultaneous calls to same handler

2015-01-22 Thread Peter W A Wood
Jacque I believe that the engine can start processing the second call before the first is finished after I did a little experiment: One card, button1, button2 and a field Both buttons with this script: on mouseUp oneOrTwo

Duplicate simultaneous calls to same handler

2015-01-22 Thread J. Landman Gay
Suppose I have a long handler that includes a few "wait with messages" so that users can continue interacting with the stack while it runs. The user does something that calls the long handler while it is still running from a previous instance. Assume there is no flag in the script to prevent th