Language basics / Programs |
The structure of a program consists of MAIN, FUNCTION or REPORT instruction blocks defined in several modules. The program starts from the MAIN block. The instruction blocks contain statements that are be executed by the runtime system in the order that they appear in the code. Program blocks cannot be nested, nor any program block divided among more than one source code module.
Some instructions can include other instructions. Such instructions are called compound statements. Every compound statement of the language supports the END statement keyword (where statement is the name of the compound statement), to mark the end of the compound statement construct within the source code module. Most compound statements also support the EXIT statement keywords, to transfer control of execution to the statement that follows the END statement keywords. By definition, every compound statement can contain at least one statement block, a group of one or more consecutive statements. In the syntax diagram of a compound statement, a statement block always includes this element.