Go to the first, previous, next, last section, table of contents.

Block Statement

<decls>
BEGIN
  <stmts>
END

The block statement is not needed nearly as frequently in Modula-3 as in other languages because Modula-3 loops, if/then statements, etc. can contain multiple statements. It allows the declaration of local variables that are visible only within the block. For example:

VAR b := FALSE;
    x := 0;
BEGIN (* block *)
  WHILE NOT b DO 
    INC(x);
    b := (x > 5);
  END (* while *)
END (* block *)


Go to the first, previous, next, last section, table of contents.