livecode - I want to Perform particular event only once -



livecode - I want to Perform particular event only once -

i have button , performs particular task. want perform particular task 1 time during sec mouse click don't want perform particular task. now, after task disable button alternative method above mentioned problem. using next code

global e on mouseup replace "\$" "{\xxdollarxx}" in field "mytextfield" set text of field "mytextfield" ss set "" yy set 0 tmp repeat = 1 number of chars in ss if char of ss contains "$" add together 1 tmp if tmp = 1 set cr & char of ss after yy else set char of ss && cr after yy set 0 tmp end if else set char of ss after yy end if end repeat set yy field "mytextfield" disable me end mouseup

i think problem duration of script. if script needs lot of time run, user may click sec time, thinking nil happened. normally, execute script twice. can prevent using wait messages , locally declared variable.

local lbusy on mouseup // first provide way force-unlock script if shiftkey downwards set false lbusy if lbusy true // warn script running beep reply error "please wait script finish." else // lock script set true lbusy repeat x = 1 100000 // takes lot of time add together 1 mysamplevar set "the current value is" && mysamplevar // msg box // create loop non-blocking wait 0 millisecs messages end repeat // unlock script set false lbusy end if end mouseup

when script starts, lbusy set true. @ end of script, lbusy set false again. long lbusy true, script won't run if click on button.

livecode

Comments

Popular posts from this blog

java - How to set log4j.defaultInitOverride property to false in jboss server 6 -

c - GStreamer 1.0 1.4.5 RTSP Example Server sends 503 Service unavailable -

Using ajax with sonata admin list view pagination -