Page 1 of 1

Console application?

Posted: Wed Jul 23, 2014 4:12 am
by JackieBlue
Hi folks. Is it possible to create a console (no user interface) application for Windows using live code? Everything I have seen shows cards. Thanks.

Re: Console application?

Posted: Wed Jul 23, 2014 6:29 am
by FourthWorld
Yes. There are some threads about it in these forums, but with GUIs being all the rage it's not commonly done. But definitely doable, though; I've made quite a few CLI apps, and increasingly make excuses to add CLI options to my GUI apps.

Making them in LC is very similar to how you'd do it in any other language: the incoming args are accessible to the app through $ vars ($1, $2, etc.), with the numbe of args available in $#. The put command goes to stdOut.

Re: Console application?

Posted: Thu Jul 24, 2014 4:42 pm
by JackieBlue
Thank you. I looked but didn't see any threads that discussed this, they seemed more hypothetical. I am going to use Live Code for some new projects but still debating about moving one I recently did in VB but need the ability to run on a scheduled basis without human intervention (i.e. - no events).

Re: Console application?

Posted: Thu Jul 24, 2014 5:44 pm
by FourthWorld
For automation you can choose CLI or GUI, since of course LC can quit itself at the end of whatever you need it to do.

In fact, I have a standalone running all the time on one of my other machines just for that purpose: it checks a folder for stacks I toss in there, opens them and runs them, and then closes them and moves them do a "done" folder when the task it was written for is completed.

So many ways to do this - can you describe a bit about what sorts of tasks you'd like LC to handle? That may help us provide more specific guidance.

Re: Console application?

Posted: Thu Jul 24, 2014 6:37 pm
by JackieBlue
Mostly running processes on the web, getting data, modifying it, and reloading. Right now I interact with 4 different web apis using XML, as well as 2 different databases systems (MS-SQL and MySQL). I currently use VB to handle the execution and web service calls. Not a big deal to move to LC yet, other than a good practice project. I do have some GUI apps I want to build. Going to go ahead and contribute, get a pro copy, and start some things. Thanks.