next up previous contents index
Next: Blank Common Blocks Up: Using Common Blocks Previous: SAVE Statements and Common

Restrictions

The dummy arguments of a procedure cannot be members of a common block nor, in a function, can the variable which has same name as the function. There are also some restrictions on the use of common block items as actual arguments of procedure calls because of the possibility of multiple definition. For example, if a procedure is defined like this:

 
       SUBROUTINE SILLY(ARG) 
       COMMON /BLOCK/ COM

And the same common block is also used in the calling unit, with a common block item as the actual argument, such as:

 
       PROGRAM DUMMY 
       COMMON /BLOCK/ VALUE 
*... 
       CALL SILLY(VALUE)

Then both ARG and COM within the subroutine SILLY are associated with the same item, VALUE, and it is therefore illegal to assign a new value to either of them.



Helen Rowlands
8/27/1998