Next: , Previous: Desktop GUI Applications, Up: Features


3.6 Console Applications

What are they?

Console Applications are stand alone binary applications that are designed to be run in text mode or that don't require a user interface.

When should I use them?

Typical uses for console applications include server side maintenance programs, utility programs, Windows services, and server daemons.

How are the source files organized?

Console application projects may contain any number of source files, including files from multiple directories under the project root. All source files will compile to a single executable binary.

Unlike compiled Web Applications, the individual source files of the project are not accessed directly. One file is designated the main file. Top level code in this file will execute when the binary starts. It should initialize the program and execute the core program code.

A typical source tree for a simple command line project may look like this:

     /console-project
       main.php
       functions.inc
       classes/
         serverclass.inc

In this theoretical project, main.php would be the main file. If this project were compiled on the command line, it would be listed as the first source file. In the IDE it would be selected as the Main File.

main.php would likely call include('functions.inc') and include('classes/serverclass.inc'), run initialization code as necessary, and then execute the core program code.

How do I create console applications?

If you are compiling from the command line, see Working With Console Applications. If you are using the Roadsend Studio IDE, set the project type to “Console Application” in see Project Properties - Project Options.