Page 1 of 1

Stop Livecode waiting for script to finish

Posted: Mon Aug 03, 2015 1:51 pm
by ChrisM
Hi,

Im using Livecode to run a few Batch files and scripts, but once I press the button the whole application freezes until the script completes, is there a way to tell livecode not to wait for the shell command/script to complete.

Thanks in Advance

Re: Stop Livecode waiting for script to finish

Posted: Wed Aug 05, 2015 6:08 pm
by ChrisM
its ok, worked it out - rather than get shell I can use open process which works.

Thanks

Re: Stop Livecode waiting for script to finish

Posted: Thu Aug 06, 2015 11:53 am
by Klaus
Hi Chris,

yep, SHELL calls are blocking in LC, unfortunately!
Should be mentioned in the docs!


Best

Klaus

Re: Stop Livecode waiting for script to finish

Posted: Thu Aug 06, 2015 3:09 pm
by FourthWorld
I believe the Dictionary entry for the shell function notes that the handler will stop until the shell call returns.

Re: Stop Livecode waiting for script to finish

Posted: Thu Aug 06, 2015 4:09 pm
by Klaus
FourthWorld wrote:I believe the Dictionary entry for the shell function notes that the handler will stop until the shell call returns.
Know or believe? :D

Yep, that is in fact mentioned in the docs, but it should be in BOLD 72 point letters!

Re: Stop Livecode waiting for script to finish

Posted: Thu Aug 06, 2015 4:18 pm
by FourthWorld
Klaus wrote:Yep, that is in fact mentioned in the docs, but it should be in BOLD 72 point letters!
You're welcome to submit an enhancement request for that Dictionary change. :)

But if we do that for everything that may not be immediately self-evident, well, it's a big language - likely a lot of 72-point type would wind up there.

When I run a shell command within Terminal, everything else there stops until that command completes. And when we consider that most things in LiveCode are blocking, it may be better to use large type to note the relatively few cases where things are non-blocking.

Re: Stop Livecode waiting for script to finish

Posted: Fri Oct 23, 2015 1:19 pm
by Ultravibe
Is there a way to launch external .exe file and continue to execute script in LiveCode without blocking?