Stop Livecode waiting for script to finish

Deploying to Windows? Utilizing VB Script execution? This is the place to ask Windows-specific questions.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
ChrisM
Posts: 24
Joined: Sat Mar 29, 2014 3:11 pm

Stop Livecode waiting for script to finish

Post 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
ChrisM
Posts: 24
Joined: Sat Mar 29, 2014 3:11 pm

Re: Stop Livecode waiting for script to finish

Post by ChrisM »

its ok, worked it out - rather than get shell I can use open process which works.

Thanks
Klaus
Posts: 14325
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Stop Livecode waiting for script to finish

Post by Klaus »

Hi Chris,

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


Best

Klaus
FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10103
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Stop Livecode waiting for script to finish

Post by FourthWorld »

I believe the Dictionary entry for the shell function notes that the handler will stop until the shell call returns.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Klaus
Posts: 14325
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Stop Livecode waiting for script to finish

Post 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!
FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10103
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Stop Livecode waiting for script to finish

Post 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.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Ultravibe
Posts: 65
Joined: Sat Jan 17, 2015 12:06 pm

Re: Stop Livecode waiting for script to finish

Post by Ultravibe »

Is there a way to launch external .exe file and continue to execute script in LiveCode without blocking?
Post Reply