Next: External Functions
Up: The Building Blocks of
Previous: Program Units
  Contents
External procedures
- are parametrised blocks of code that perform a specific task;
this section of code is written once, and can be reffered to
as many times as needed;
- are ``independent'' units which may be compiled separately;
- communicate with other program units via arguments, returned values
(functions only), and global variables (to be discussed another lecture);
- can be used as arguments in other procedure calls.
Advantages
- avoid code duplication (when same task appears several times
in our program);
- lead to modularization of programs. The general principle of dividing
the problem into subproblems, and managing the subproblems separately, can be
naturally implemented using procedures;
- make software reusable (pieces can be used later
in a different context);
In F95 there are 2 types of external procedures,
- functions, and
- subroutines.
Adrian Sandu
2001-08-26