Console app, output to console?

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

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

Re: Console app, output to console?

Post by FourthWorld »

On Linux, calling a standalone with -ui results in any put statements going back to the terminal.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3582
Joined: Mon Jan 22, 2007 7:36 am
Contact:

Re: Console app, output to console?

Post by mwieder »

Ah. So it does. I wonder if the -ui trick will redirect puts on Windows as well?
trenatos
Posts: 189
Joined: Wed Jul 03, 2013 6:46 am
Contact:

Re: Console app, output to console?

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

Re: Console app, output to console?

Post 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.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
trenatos
Posts: 189
Joined: Wed Jul 03, 2013 6:46 am
Contact:

Re: Console app, output to console?

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

Re: Console app, output to console?

Post 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?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3582
Joined: Mon Jan 22, 2007 7:36 am
Contact:

Re: Console app, output to console?

Post 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.
Post Reply