# Console Application Runner Classes
ReadMe

## Description

These classes are designed to be used to control the execution of child console application processes. There are two classes: a class named TPJCustomConsoleApp that is provided a base class for user-defined sub-classes, and TPJConsoleApp that is used to provide a general way to run and manipulate console applications. Both classes are provided in a single unit, PJConsoleApp.

The classes enable the console application's standard input, standard output and standard error to be redirected to and from files or pipes. The classes can also time-slice the running of the console application to enable the calling application to continue processing and to enable redirected piped output to be processed.

For full details please see the online documentation.

### Compatibility

The classes require Delphi 7 and later.

PJConsoleApp is suitable for compilation with both the 32 bit and 64 bit Delphi compilers (Delphi XE2 and later). However, the unit uses the Windows API so is not suitable for compilation for OSX.

The classes can be used with both the VCL and FireMonkey frameworks.

## Installation

The Console Application Runner Classes and associated documentation and demo program source files are supplied in a zip file. Before installing, or using, you need to extract all the files from the zip file, preserving the directory structure. The following files will be extracted:

- `PJConsoleApp.pas` – The source code of the console application runner classes.
- `Docs\ChangeLog.txt` – The project's change log.
- `Docs\Documentation.URL` – Short-cut to the project's online documentation.
- `Docs\MPL-2.0.txt` – Mozilla Public License v2.0.
- `Docs\ReadMe.htm` – The project's read-me file.

In addition to the above files you will find numerous demo projects in the `Demos` sub-directory.

There are three possible ways to use the units.

1. The simplest way is to add `PJConsoleApp.pas` to your projects as and when you need it.
2. To make the unit easier to re-use you can either copy it to a folder on your Delphi search path, or add the folder where you extracted the units to the search path. You then simply use the units as required without needing to add them to your project.
3. For maximum portability you can add the unit to a Delphi design time package. If you need help doing this see here.

## Demo Programs

The source code for numerous demo projects is included in the download. All the demos and supporting files are stored in sub-folders of the `Demos` directory.

Please note that some of the demos use units and classes from the DelphiDabbler IO Utility Classes project. Before attempting to compile the affected demos you need to download this project and copy the required units to the `Demos\IOUtils` directory. Users of Delphi XE5 and later must use IO Utility Classes v1.0.1 or later.

For more information see the file `README.txt` in the `Demos` directory.

The demo programs are described in the Examples section of the online documentation.

## Update History

A complete change log is provided in a text file that is included in the download.

## License

The Console Application Runner Classes are released under the terms of the Mozilla Public License, v2.0.

## Bugs and Feature Requests

Bugs can be reported or new features requested via the Issue Tracker.

If no similar report or request has been recorded already, use the New Issue link to add a new issue. Please select the most appropriate template from the Templates drop down list and apply the `Project-consoleapp` label. If there is already a similar issue please add a comment to it if there's anything you can add.

## About the Author

I'm Peter Johnson – a hobbyist programmer living in Ceredigion in West Wales, UK, writing write mainly in Delphi. My programs are available for download from http://www.delphidabbler.com/.

Please let me know if you have any comments about the classes, but please use the Issue Tracker discussed above to report bugs and request new features.
This document is copyright © 2007-2014, P D Johnson, www.delphidabbler.com