t3x.org / t3x / t3x-manual / 2E.html
 
T3X - A Minimum Procedural Language
Version 8.1.5, Online Edition
Copyright(C) 1996-2004
Nils M Holm
 
Previous:
2.13 Meta Commands
TOC | Index | Back Next:
3. The Runtime Environment

2.14 The Main Program

Each program has an initial entry point where the execution begins at run time. In T3X, the entry point is formed by a compound statement at the global level. This compound statement is mandatory and it must always be the last definition of the entire program. Consequently, the minimum valid T3X program is

DO END

The main procedure, like any other compound statement, may declare its own local symbols. Since it has no name, it cannot recurse, though. RETURN may not be used in it, because there is no procedure to return to.

When executation reaches the end of the main procedure, the program terminates and delivers a zero return code back to the calling process. To deliver a distinct return value, HALT may be used.

Previous:
2.13 Meta Commands
TOC | Index | Back Next:
3. The Runtime Environment