t3x.org / t3x / t3x-manual / 27.html
 
T3X - A Minimum Procedural Language
Version 8.1.5, Online Edition
Copyright(C) 1996-2004
Nils M Holm
 
Previous:
2.6.10 Order of Evaluation
TOC | Index | Back Next:
2.7.1 Assignments

2.7 Statements

Statements are the basic building stones of T3X programs. While expressions just have a value, statements are used to `tell the program to do something'. Therefore, T3X is called an imperative language. Each program is a list of commands which is executed in sequence. Each command is also called a statement in the terminology of imperative programming.

There are different kinds of statements: assignments, procedure calls, conditional statements, loop statements, branch statements, and compound statements. The assignment is an essential part of every imperative language. Frequently, it is even used to characterize the imperative approach. Compound statemements do not have an own meaning, but they are used to group statements to form the bodies of loops, conditionals, and procedures. All other statement types serve the control of the program's flow.

In T3X, all statements have to be terminated with a semicolon. This means that a semicolon must follow every statement in a program. The only exception is the compound statement, which is delimited by the keywords DO and END. No semicolon is expected after END. In other procedural languages (like BCPL and Pascal), statements are separated rather than terminated. In such languages, a delimiter is only necessary, if two or more statements are written in sequence - there may not be any delimiter after the last statement. The separation rules in some languages are rather complex and the saving in delimiters is usually not worth the extra expense of having to remember these rules. Therefore, the most simple form of combining statements has been chosen in T3X: Each (non-compound) statement has to be terminated.

Previous:
2.6.10 Order of Evaluation
TOC | Index | Back Next:
2.7.1 Assignments