CLI Standalone App does not quit (Windows)

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
dbcbos
Posts: 23
Joined: Sun Jun 24, 2012 9:49 am

CLI Standalone App does not quit (Windows)

Post by dbcbos » Thu Aug 24, 2017 11:35 am

I have build a standalone App that does not quit after I output something to stdout

It does quit if I do not write to stdout

Any ideas, might be a Windows setting i'm thinking. I did use:

Code: Select all

quit

or

quit 0
As stated in the dictionary

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: CLI Standalone App does not quit (Windows)

Post by bogs » Thu Aug 24, 2017 3:29 pm

I don't write for Windows, but is it possible you have to exit the shell (stdout) before closing the standalone?

The equivalent of
Image
on Windows.
Image

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7228
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: CLI Standalone App does not quit (Windows)

Post by jacque » Thu Aug 24, 2017 7:06 pm

Right, standalones won't quit if there are any open processes, or any pending messages.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: CLI Standalone App does not quit (Windows)

Post by bogs » Sat Aug 26, 2017 4:36 am

I seem to remember reading somewhere that there was a way to code killing all remaining processes. Boy I hate getting old and senile :(
Image

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7228
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: CLI Standalone App does not quit (Windows)

Post by jacque » Sat Aug 26, 2017 4:55 am

I'm not sure about all processes but you can do them individually with "close process".
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: CLI Standalone App does not quit (Windows)

Post by bogs » Sat Aug 26, 2017 5:27 am

You know, I seem to think it was in one of the many many (did I say many?) articles I've read over the last few months, however, while I can't think of exactly which it was (I'll get back to you on it if I find it again :roll: ), I suppose it could have posed closing multiple processes through a repeat loop, one at a time, just to make sure they were all closed. Then it automatically closed the stack when the last process was killed off.

I still think I remember there was one statement that killed them all in one go, but it wasn't recommended. I'll start the trip down memory lane (HAH) tomorrow. Provided I remember...
Image

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2262
Joined: Thu Feb 28, 2013 11:52 pm
Location: Göttingen, DE

Re: CLI Standalone App does not quit (Windows)

Post by [-hh] » Sat Aug 26, 2017 11:49 am

Which method do you use to write to stdout?
And why is it of a nature that can hang and block the sender?

Anyway:
If you have a process id or process name then you could try "kill".
This is LC command that works on Mac/Win/linux (see dictionary).

Or on windows try to use directly (via LC's shell) "taskkill":
https://technet.microsoft.com/de-de/lib ... 91009.aspx
shiftLock happens

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7228
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: CLI Standalone App does not quit (Windows)

Post by jacque » Sat Aug 26, 2017 6:52 pm

I still think I remember there was one statement that killed them all in one go, but it wasn't recommended
I have only seen this:

Code: Select all

repeat for each line x in the openProcesses
  close process x
end repeat 
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: CLI Standalone App does not quit (Windows)

Post by bogs » Sat Aug 26, 2017 7:56 pm

jacque wrote:
I still think I remember there was one statement that killed them all in one go, but it wasn't recommended
I have only seen this:

Code: Select all

repeat for each line x in the openProcesses
  close process x
end repeat 
Well, I did say it could have been a repeat statement, didn't I? :lol:

That does indeed look familiar, and could well be it, and it sure looks safe enough. I was unable to find where I was originally reading it again to this point, so I'd say run with that :D always remembering of course, that it does take a little time for each process to actually close if I recall correctly.
Image

ghettocottage
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 366
Joined: Tue Apr 10, 2012 9:18 am

Re: CLI Standalone App does not quit (Windows)

Post by ghettocottage » Mon Aug 28, 2017 2:45 am

can you just write a little batch script that you launch separately and include that script in your standalone? That would allow your standalone to proceed with whatever while the batch script runs/quits on its own.

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”