Page 2 of 2

Re: Console app, output to console?

Posted: Fri Aug 09, 2013 6:45 am
by FourthWorld
On Linux, calling a standalone with -ui results in any put statements going back to the terminal.

Re: Console app, output to console?

Posted: Fri Aug 09, 2013 7:09 am
by mwieder
Ah. So it does. I wonder if the -ui trick will redirect puts on Windows as well?

Re: Console app, output to console?

Posted: Fri Aug 09, 2013 7:16 am
by trenatos
I wish there was a compiler setting that let you compile console programs.
It would reduce size and you wouldn't need that -ui variable just to run a program.

Re: Console app, output to console?

Posted: Fri Aug 09, 2013 2:29 pm
by FourthWorld
trenatos wrote:I wish there was a compiler setting that let you compile console programs.
It would reduce size and you wouldn't need that -ui variable just to run a program.
It's kinda cool as it is: LC is primarily for GUI apps, with LiveCode Server used for CGI and other CLI stuff. But with the desktop version's -ui flag you can deliver one app that works in both modes: a GUI for users who need it, and a CLI for using the app's routines as middleware in a larger automated process run by a shell script.

Re: Console app, output to console?

Posted: Fri Aug 09, 2013 6:20 pm
by trenatos
It's certainly cool, but a simple checkbox for CLI apps would make it even better, and then we wouldn't have to tell people to use the -ui option as default when launching the application.

Besides, I think I read somewhere that LC server is not continuing?

If it is, I'd be curious about it, especially if it's more suitable for CLI programming, I haven't found much info about it.

Re: Console app, output to console?

Posted: Fri Aug 09, 2013 7:45 pm
by FourthWorld
LC Server is alive and well, and kept current with the other builds.

It's ideally suited for CGI work, with some conveniences for mixing LiveCode statements and HTML in the same page. But it can be used for other CLI apps as well.

@Mark Wieder: Can you think of a way the standalone build process might include a flag in the build to obviate the need to pass -ui to the app to run facelessly?

Re: Console app, output to console?

Posted: Fri Aug 09, 2013 8:59 pm
by mwieder
@Mark Wieder: Can you think of a way the standalone build process might include a flag in the build to obviate the need to pass -ui to the app to run facelessly?
Sure - it shouldn't be hard to do, either a checkbox for "console app" or a separate selection at the top. But the standalone builder is part of the IDE and isn't part of any of the engine work that's currently in progress.

I'd see this as a coordination of a small engine change and a standalone builder change: the -ui argument sets a flag in the engine, and there would need to be a way to set it aside from the command line. That's the engine change. Then the standalone builder would have to set something that tells the startup process that that's what's desired.