Contents | Prev | Next

9.2 Empty statement

Description

Empty statements don't perform any action, and are usually created when the rules of Pascal require a statement to exist but you don't specify one. For example if you write

   begin
   end

then technically according to the rules of Pascal there must be a statement between the begin and the end, and since there is nothing there the empty statement is said to exist there. Empty statements also commonly occur when statement sequences have a trailing semi-colon. In Pascal, the semi-colon is used as a statement separator and not a statement terminator so the following statement-sequence

   a;
   b;

actually contains three statements, the statement a, the statement b, and an empty statement following b. Since a semi-colon follows b then it must separate b from another statement.

Syntax

   empty-statement =

Contents | Prev | Next