next up previous contents index
Next: Using Common Blocks Up: Professional Programmer's Guide to Previous: General Rules

Common Blocks

 

A common block is a list of variables and arrays stored in a named area which may be accessed directly in more than one program unit. Common blocks are mainly used to transfer information from one program unit to another; they can be used in as an alternative to argument-list transfers or in addition to them.

Common blocks are sometimes used to fit large programs into small computers by arranging for several program units to share a common pool of memory. This is not a recommended programming practice and is likely to become redundant with the spread of virtual-memory operating systems.

The name of a common block is an external name which must be different from all other global names, such as those of procedures, in the executable program. The variables and arrays stored with the block cannot be initialised in the normal way, but only in a BLOCK DATA program unit which was invented especially for this purpose.





Mario Storti
Wed Nov 4 19:32:56 ART 1998