Page 1 of 1

MergBG

Posted: Thu Jan 24, 2019 12:42 pm
by hrcap
Hi Guys

I was wondering if MergBG (or any other method) could be used to allow two scripts to run at the same time.

If for example you have a button with:

on mouseup
Wait 3 seconds
answer "hello"
end mouseup

you cannot click any of the other buttons on the layout until this script has finished running.

Many Thanks

Re: MergBG

Posted: Thu Jan 24, 2019 1:19 pm
by bogs
I don't know about mergBg, and Lc doesn't support actual multi-threading, but maybe this is what your looking for?

Re: MergBG

Posted: Thu Jan 24, 2019 1:20 pm
by Klaus
Hi hrcap,

this is no question of MerBG or whatever!
A "wait" statement will stop the engine and, as you told it, it will wait the amount of time specified, UNLESS you tell it to take care of everything else in the meantime, too. Do this by adding "with messages":

Code: Select all

on mouseup
  Wait 3 seconds with messges
  answer "hello"
end mouseup
This way, the engine will be able to take care of whatever during this 3 seconds. :D


Best

Klaus