Program Structure

Each program written in CTL must have the following structure:

ImportStatements
VariableDeclarations
FunctionDeclarations
Statements
Mappings

Remember that the ImportStatements must be at the beginning of the program and the Mappings must be at its end. Both ImportStatements and Mappings may consist of more individual statements or mappings and each of them must be terminated by semicolon. The middle part of the program can be interspersed. Individual declaration of variables and functions and individual statements does not need to be in this order. But they always must use only declared variables and functions! Thus, first you need to declare variable and/or function before you can use it in some statement or another declaration of variable and function.