Console application?

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

Post Reply
JackieBlue
Posts: 32
Joined: Sun Jun 22, 2014 2:37 am

Console application?

Post by JackieBlue » Wed Jul 23, 2014 4:12 am

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.

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

Re: Console application?

Post by FourthWorld » Wed Jul 23, 2014 6:29 am

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.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

JackieBlue
Posts: 32
Joined: Sun Jun 22, 2014 2:37 am

Re: Console application?

Post by JackieBlue » Thu Jul 24, 2014 4:42 pm

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).

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

Re: Console application?

Post by FourthWorld » Thu Jul 24, 2014 5:44 pm

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.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

JackieBlue
Posts: 32
Joined: Sun Jun 22, 2014 2:37 am

Re: Console application?

Post by JackieBlue » Thu Jul 24, 2014 6:37 pm

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.

Post Reply