next up previous contents index
Next: Scope Up: Programsunits, blocks Previous: Units

Blocks

Units and programs are made of blocks. A block is made of declarations of labels, constants, types variables and functions or procedures. Blocks can be nested in certain ways, i.e., a procedure or function declaration can have blocks in themselves.

A block looks like the following:


Blocks

syntdiag4715

syntdiag4719

syntdiag4723

syntdiag4727

syntdiag4731

syntdiag4735

syntdiag4739

syntdiag4743

Labels that can be used to identify statements in a block are declared in the label declaration part of that block. Each label can only identify one statement.

Constants that are to be used only in one block should be declared in that block's constant declaration part.

Variables that are to be used only in one block should be declared in that block's constant declaration part.

Types that are to be used only in one block should be declared in that block's constant declaration part.

Lastly, functions and procedures that will be used in that block can be declared in the procedure/function declaration part.

After the different declaration parts comes the statement part. This contains any actions that the block should execute. All identifiers declared before the statement part can be used in that statement part.


next up previous contents index
Next: Scope Up: Programsunits, blocks Previous: Units

Michael Van Canneyt
Fri Sep 25 09:15:40 MEST 1998